@nrwl/angular 14.0.0-beta.0 → 14.0.0-beta.1

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 (108) hide show
  1. package/executors.json +10 -0
  2. package/generators.d.ts +2 -2
  3. package/generators.js +2 -2
  4. package/generators.js.map +1 -1
  5. package/generators.json +16 -20
  6. package/migrations.json +6 -0
  7. package/ng-package.json +1 -0
  8. package/package.json +8 -6
  9. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +6 -0
  10. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +38 -0
  11. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js.map +1 -0
  12. package/src/builders/module-federation-dev-server/schema.d.ts +20 -0
  13. package/src/builders/module-federation-dev-server/schema.json +108 -0
  14. package/src/generators/application/files/tsconfig.editor.json__tpl__ +1 -7
  15. package/src/generators/application/lib/update-editor-tsconfig.d.ts +1 -1
  16. package/src/generators/application/lib/update-editor-tsconfig.js +14 -2
  17. package/src/generators/application/lib/update-editor-tsconfig.js.map +1 -1
  18. package/src/generators/application/schema.json +5 -5
  19. package/src/generators/convert-to-with-mf/convert-to-with-mf.js +4 -4
  20. package/src/generators/convert-to-with-mf/convert-to-with-mf.js.map +1 -1
  21. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +1 -1
  22. package/src/generators/{mfe-host/mfe-host.compat.d.ts → host/host.compat.d.ts} +0 -0
  23. package/src/generators/host/host.compat.js +6 -0
  24. package/src/generators/host/host.compat.js.map +1 -0
  25. package/src/generators/host/host.d.ts +3 -0
  26. package/src/generators/host/host.js +34 -0
  27. package/src/generators/host/host.js.map +1 -0
  28. package/src/generators/{mfe-host → host}/schema.d.ts +0 -0
  29. package/src/generators/{mfe-host → host}/schema.json +5 -5
  30. package/src/generators/karma/karma.js +1 -0
  31. package/src/generators/karma/karma.js.map +1 -1
  32. package/src/generators/library/library.js +2 -7
  33. package/src/generators/library/library.js.map +1 -1
  34. package/src/generators/ng-add/migrate-from-angular-cli.js +9 -6
  35. package/src/generators/ng-add/migrate-from-angular-cli.js.map +1 -1
  36. package/src/generators/ng-add/schema.d.ts +0 -1
  37. package/src/generators/ng-add/schema.json +0 -7
  38. package/src/generators/ng-add/utilities/app.migrator.d.ts +1 -3
  39. package/src/generators/ng-add/utilities/app.migrator.js +27 -58
  40. package/src/generators/ng-add/utilities/app.migrator.js.map +1 -1
  41. package/src/generators/ng-add/utilities/{e2e-project.migrator.d.ts → e2e.migrator.d.ts} +0 -0
  42. package/src/generators/ng-add/utilities/{e2e-project.migrator.js → e2e.migrator.js} +32 -11
  43. package/src/generators/ng-add/utilities/e2e.migrator.js.map +1 -0
  44. package/src/generators/ng-add/utilities/lib.migrator.d.ts +26 -0
  45. package/src/generators/ng-add/utilities/lib.migrator.js +351 -0
  46. package/src/generators/ng-add/utilities/lib.migrator.js.map +1 -0
  47. package/src/generators/ng-add/utilities/normalize-options.js +5 -2
  48. package/src/generators/ng-add/utilities/normalize-options.js.map +1 -1
  49. package/src/generators/ng-add/utilities/project.migrator.d.ts +11 -2
  50. package/src/generators/ng-add/utilities/project.migrator.js +82 -4
  51. package/src/generators/ng-add/utilities/project.migrator.js.map +1 -1
  52. package/src/generators/ng-add/utilities/types.d.ts +9 -1
  53. package/src/generators/ng-add/utilities/validate-projects.d.ts +2 -0
  54. package/src/generators/ng-add/utilities/validate-projects.js +46 -0
  55. package/src/generators/ng-add/utilities/validate-projects.js.map +1 -0
  56. package/src/generators/ng-add/utilities/validation-logging.d.ts +2 -0
  57. package/src/generators/ng-add/utilities/validation-logging.js +20 -0
  58. package/src/generators/ng-add/utilities/validation-logging.js.map +1 -0
  59. package/src/generators/ng-add/utilities/workspace.d.ts +1 -1
  60. package/src/generators/ng-add/utilities/workspace.js +13 -17
  61. package/src/generators/ng-add/utilities/workspace.js.map +1 -1
  62. package/src/generators/{mfe-remote/mfe-remote.compat.d.ts → remote/remote.compat.d.ts} +0 -0
  63. package/src/generators/remote/remote.compat.js +6 -0
  64. package/src/generators/remote/remote.compat.js.map +1 -0
  65. package/src/generators/remote/remote.d.ts +3 -0
  66. package/src/generators/remote/remote.js +76 -0
  67. package/src/generators/remote/remote.js.map +1 -0
  68. package/src/generators/{mfe-remote → remote}/schema.d.ts +0 -0
  69. package/src/generators/{mfe-remote → remote}/schema.json +5 -5
  70. package/src/generators/setup-mfe/files/webpack/{mfe.config.js__tmpl__ → module-federation.config.js__tmpl__} +0 -0
  71. package/src/generators/setup-mfe/files/webpack/webpack.config.js__tmpl__ +1 -1
  72. package/src/generators/setup-mfe/files/webpack/webpack.prod.config.js__tmpl__ +1 -1
  73. package/src/generators/setup-mfe/lib/add-remote-to-host.js +10 -10
  74. package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +1 -1
  75. package/src/generators/setup-mfe/lib/fix-bootstrap.js +3 -3
  76. package/src/generators/setup-mfe/lib/fix-bootstrap.js.map +1 -1
  77. package/src/generators/setup-mfe/lib/generate-config.js +1 -1
  78. package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
  79. package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js +3 -3
  80. package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js.map +1 -1
  81. package/src/generators/setup-mfe/lib/setup-serve-target.js +3 -23
  82. package/src/generators/setup-mfe/lib/setup-serve-target.js.map +1 -1
  83. package/src/generators/utils/dependencies.d.ts +2 -0
  84. package/src/generators/utils/dependencies.js +15 -0
  85. package/src/generators/utils/dependencies.js.map +1 -0
  86. package/src/migrations/update-13-8-1/add-cypress-mfe-workaround.js +2 -2
  87. package/src/migrations/update-13-8-1/add-cypress-mfe-workaround.js.map +1 -1
  88. package/src/migrations/update-14-0-0/rename-mf-config.d.ts +2 -0
  89. package/src/migrations/update-14-0-0/rename-mf-config.js +27 -0
  90. package/src/migrations/update-14-0-0/rename-mf-config.js.map +1 -0
  91. package/src/utils/{get-mfe-projects.d.ts → get-mf-projects.d.ts} +1 -1
  92. package/src/utils/{get-mfe-projects.js → get-mf-projects.js} +4 -4
  93. package/src/utils/get-mf-projects.js.map +1 -0
  94. package/src/utils/mfe/mfe-webpack.js +3 -3
  95. package/src/utils/mfe/mfe-webpack.js.map +1 -1
  96. package/src/utils/versions.js +1 -1
  97. package/src/generators/mfe-host/mfe-host.compat.js +0 -6
  98. package/src/generators/mfe-host/mfe-host.compat.js.map +0 -1
  99. package/src/generators/mfe-host/mfe-host.d.ts +0 -3
  100. package/src/generators/mfe-host/mfe-host.js +0 -22
  101. package/src/generators/mfe-host/mfe-host.js.map +0 -1
  102. package/src/generators/mfe-remote/mfe-remote.compat.js +0 -6
  103. package/src/generators/mfe-remote/mfe-remote.compat.js.map +0 -1
  104. package/src/generators/mfe-remote/mfe-remote.d.ts +0 -3
  105. package/src/generators/mfe-remote/mfe-remote.js +0 -31
  106. package/src/generators/mfe-remote/mfe-remote.js.map +0 -1
  107. package/src/generators/ng-add/utilities/e2e-project.migrator.js.map +0 -1
  108. package/src/utils/get-mfe-projects.js.map +0 -1
package/executors.json CHANGED
@@ -24,6 +24,11 @@
24
24
  "implementation": "./src/builders/webpack-server/webpack-server.impl",
25
25
  "schema": "./src/builders/webpack-server/schema.json",
26
26
  "description": "The `webpack-server` executor is very similar to the standard `dev-server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration."
27
+ },
28
+ "module-federation-dev-server": {
29
+ "implementation": "./src/builders/module-federation-dev-server/module-federation-dev-server.impl",
30
+ "schema": "./src/builders/module-federation-dev-server/schema.json",
31
+ "description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host."
27
32
  }
28
33
  },
29
34
  "builders": {
@@ -51,6 +56,11 @@
51
56
  "implementation": "./src/builders/webpack-server/webpack-server.impl",
52
57
  "schema": "./src/builders/webpack-server/schema.json",
53
58
  "description": "The `webpack-server` executor is very similar to the standard `dev-server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration."
59
+ },
60
+ "module-federation-dev-server": {
61
+ "implementation": "./src/builders/module-federation-dev-server/module-federation-dev-server.impl",
62
+ "schema": "./src/builders/module-federation-dev-server/schema.json",
63
+ "description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host."
54
64
  }
55
65
  }
56
66
  }
package/generators.d.ts CHANGED
@@ -13,7 +13,7 @@ export * from './src/generators/stories/stories';
13
13
  export * from './src/generators/storybook-configuration/storybook-configuration';
14
14
  export * from './src/generators/upgrade-module/upgrade-module';
15
15
  export * from './src/generators/setup-mfe/setup-mfe';
16
- export * from './src/generators/mfe-host/mfe-host';
16
+ export * from './src/generators/host/host';
17
17
  export * from './src/generators/scam/scam';
18
18
  export * from './src/generators/scam-directive/scam-directive';
19
19
  export * from './src/generators/scam-pipe/scam-pipe';
@@ -21,4 +21,4 @@ export * from './src/generators/add-linting/add-linting';
21
21
  export * from './src/generators/component-cypress-spec/component-cypress-spec';
22
22
  export * from './src/generators/component-story/component-story';
23
23
  export * from './src/generators/web-worker/web-worker';
24
- export * from './src/generators/mfe-remote/mfe-remote';
24
+ export * from './src/generators/remote/remote';
package/generators.js CHANGED
@@ -16,7 +16,7 @@ tslib_1.__exportStar(require("./src/generators/stories/stories"), exports);
16
16
  tslib_1.__exportStar(require("./src/generators/storybook-configuration/storybook-configuration"), exports);
17
17
  tslib_1.__exportStar(require("./src/generators/upgrade-module/upgrade-module"), exports);
18
18
  tslib_1.__exportStar(require("./src/generators/setup-mfe/setup-mfe"), exports);
19
- tslib_1.__exportStar(require("./src/generators/mfe-host/mfe-host"), exports);
19
+ tslib_1.__exportStar(require("./src/generators/host/host"), exports);
20
20
  tslib_1.__exportStar(require("./src/generators/scam/scam"), exports);
21
21
  tslib_1.__exportStar(require("./src/generators/scam-directive/scam-directive"), exports);
22
22
  tslib_1.__exportStar(require("./src/generators/scam-pipe/scam-pipe"), exports);
@@ -24,5 +24,5 @@ tslib_1.__exportStar(require("./src/generators/add-linting/add-linting"), export
24
24
  tslib_1.__exportStar(require("./src/generators/component-cypress-spec/component-cypress-spec"), exports);
25
25
  tslib_1.__exportStar(require("./src/generators/component-story/component-story"), exports);
26
26
  tslib_1.__exportStar(require("./src/generators/web-worker/web-worker"), exports);
27
- tslib_1.__exportStar(require("./src/generators/mfe-remote/mfe-remote"), exports);
27
+ tslib_1.__exportStar(require("./src/generators/remote/remote"), exports);
28
28
  //# sourceMappingURL=generators.js.map
package/generators.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../packages/angular/generators.ts"],"names":[],"mappings":";;;AAAA,mFAAyD;AACzD,6GAAmF;AACnF,6FAAmE;AACnE,qEAA2C;AAC3C,uEAA6C;AAC7C,uFAA6D;AAC7D,2EAAiD;AACjD,uHAA6F;AAC7F,qEAA2C;AAC3C,qEAA2C;AAC3C,yFAA+D;AAC/D,2EAAiD;AACjD,2GAAiF;AACjF,yFAA+D;AAC/D,+EAAqD;AACrD,6EAAmD;AACnD,qEAA2C;AAC3C,yFAA+D;AAC/D,+EAAqD;AACrD,mFAAyD;AACzD,yGAA+E;AAC/E,2FAAiE;AACjE,iFAAuD;AACvD,iFAAuD"}
1
+ {"version":3,"file":"generators.js","sourceRoot":"","sources":["../../../packages/angular/generators.ts"],"names":[],"mappings":";;;AAAA,mFAAyD;AACzD,6GAAmF;AACnF,6FAAmE;AACnE,qEAA2C;AAC3C,uEAA6C;AAC7C,uFAA6D;AAC7D,2EAAiD;AACjD,uHAA6F;AAC7F,qEAA2C;AAC3C,qEAA2C;AAC3C,yFAA+D;AAC/D,2EAAiD;AACjD,2GAAiF;AACjF,yFAA+D;AAC/D,+EAAqD;AACrD,qEAA2C;AAC3C,qEAA2C;AAC3C,yFAA+D;AAC/D,+EAAqD;AACrD,mFAAyD;AACzD,yGAA+E;AAC/E,2FAAiE;AACjE,iFAAuD;AACvD,yEAA+C"}
package/generators.json CHANGED
@@ -71,11 +71,10 @@
71
71
  "aliases": ["secondary-entry-point", "entry-point"],
72
72
  "description": "Creates a secondary entry point for an Angular publishable library."
73
73
  },
74
- "mfe-remote": {
75
- "factory": "./src/generators/mfe-remote/mfe-remote.compat",
76
- "schema": "./src/generators/mfe-remote/schema.json",
77
- "aliases": ["remote"],
78
- "description": "Generate a Remote Angular Micro-Frontend Application."
74
+ "remote": {
75
+ "factory": "./src/generators/remote/remote.compat",
76
+ "schema": "./src/generators/remote/schema.json",
77
+ "description": "Generate a Remote Angular Module Federation Application."
79
78
  },
80
79
  "move": {
81
80
  "factory": "./src/generators/move/move#angularMoveSchematic",
@@ -88,11 +87,10 @@
88
87
  "schema": "./src/generators/convert-to-with-mf/schema.json",
89
88
  "description": "Converts an old micro frontend configuration to use the new `withModuleFederation` helper. It will run successfully if the following conditions are met: \n - Is either a host or remote application \n - Shared npm package configurations have not been modified \n - Name used to identify the Micro Frontend application matches the project name \n\n _**Note:** This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!_"
90
89
  },
91
- "mfe-host": {
92
- "factory": "./src/generators/mfe-host/mfe-host.compat",
93
- "schema": "./src/generators/mfe-host/schema.json",
94
- "aliases": ["host"],
95
- "description": "Generate a Host Angular Micro Frontend Application."
90
+ "host": {
91
+ "factory": "./src/generators/host/host.compat",
92
+ "schema": "./src/generators/host/schema.json",
93
+ "description": "Generate a Host Angular Module Federation Application."
96
94
  },
97
95
  "ng-add": {
98
96
  "factory": "./src/generators/ng-add/compat",
@@ -220,11 +218,10 @@
220
218
  "aliases": ["secondary-entry-point", "entry-point"],
221
219
  "description": "Creates a secondary entry point for an Angular publishable library."
222
220
  },
223
- "mfe-remote": {
224
- "factory": "./src/generators/mfe-remote/mfe-remote",
225
- "schema": "./src/generators/mfe-remote/schema.json",
226
- "aliases": ["remote"],
227
- "description": "Generate a Remote Angular Micro-Frontend Application."
221
+ "remote": {
222
+ "factory": "./src/generators/remote/remote",
223
+ "schema": "./src/generators/remote/schema.json",
224
+ "description": "Generate a Remote Angular Module Federation Application."
228
225
  },
229
226
  "move": {
230
227
  "factory": "./src/generators/move/move#angularMoveGenerator",
@@ -237,11 +234,10 @@
237
234
  "schema": "./src/generators/convert-to-with-mf/schema.json",
238
235
  "description": "Converts an old micro frontend configuration to use the new withModuleFederation helper. It will run successfully if the following conditions are met: \n - Is either a host or remote application \n - Shared npm package configurations have not been modified \n - Name used to identify the Micro Frontend application matches the project name \n\n _**Note:** This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!_"
239
236
  },
240
- "mfe-host": {
241
- "factory": "./src/generators/mfe-host/mfe-host",
242
- "schema": "./src/generators/mfe-host/schema.json",
243
- "aliases": ["host"],
244
- "description": "Generate a Host Angular Micro Frontend Application."
237
+ "host": {
238
+ "factory": "./src/generators/host/host",
239
+ "schema": "./src/generators/host/schema.json",
240
+ "description": "Generate a Host Angular Module Federation Application."
245
241
  },
246
242
  "ng-add": {
247
243
  "factory": "./src/generators/ng-add/ng-add",
package/migrations.json CHANGED
@@ -106,6 +106,12 @@
106
106
  "version": "13.9.0-beta.4",
107
107
  "description": "Set buildLibsFromSource property to false to not break existing usage.",
108
108
  "factory": "./src/migrations/update-13-9-0/set-build-libs-from-source"
109
+ },
110
+ "rename-module-federation-config": {
111
+ "cli": "nx",
112
+ "version": "14.0.0-beta.1",
113
+ "description": "Rename mfe.config.js to module-federation.config.js for consistent terminology.",
114
+ "factory": "./src/migrations/update-14-0-0/rename-mf-config"
109
115
  }
110
116
  },
111
117
  "packageJsonUpdates": {
package/ng-package.json CHANGED
@@ -9,6 +9,7 @@
9
9
  "@angular-eslint/",
10
10
  "@schematics",
11
11
  "@phenomnomnominal/tsquery",
12
+ "chalk",
12
13
  "ignore",
13
14
  "jasmine-marbles",
14
15
  "rxjs-for-await",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/angular",
3
- "version": "14.0.0-beta.0",
3
+ "version": "14.0.0-beta.1",
4
4
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, Karma, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,13 +65,15 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@angular-devkit/schematics": "~13.3.0",
68
- "@nrwl/cypress": "14.0.0-beta.0",
69
- "@nrwl/devkit": "14.0.0-beta.0",
70
- "@nrwl/jest": "14.0.0-beta.0",
71
- "@nrwl/linter": "14.0.0-beta.0",
72
- "@nrwl/storybook": "14.0.0-beta.0",
68
+ "@nrwl/cypress": "14.0.0-beta.1",
69
+ "@nrwl/devkit": "14.0.0-beta.1",
70
+ "@nrwl/jest": "14.0.0-beta.1",
71
+ "@nrwl/linter": "14.0.0-beta.1",
72
+ "@nrwl/storybook": "14.0.0-beta.1",
73
+ "@nrwl/workspace": "14.0.0-beta.1",
73
74
  "@schematics/angular": "~13.3.0",
74
75
  "@phenomnomnominal/tsquery": "4.1.1",
76
+ "chalk": "4.1.0",
75
77
  "ignore": "^5.0.4",
76
78
  "jasmine-marbles": "~0.8.4",
77
79
  "rxjs-for-await": "0.0.2",
@@ -0,0 +1,6 @@
1
+ import type { Schema } from './schema';
2
+ import { BuilderContext } from '@angular-devkit/architect';
3
+ import { JsonObject } from '@angular-devkit/core';
4
+ export declare function moduleFederationDevServer(schema: Schema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/build-angular").DevServerBuilderOutput>;
5
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<JsonObject & Schema>;
6
+ export default _default;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.moduleFederationDevServer = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nrwl/devkit");
6
+ const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
7
+ const architect_1 = require("@angular-devkit/architect");
8
+ const path_1 = require("path");
9
+ const webpack_server_impl_1 = require("../webpack-server/webpack-server.impl");
10
+ function moduleFederationDevServer(schema, context) {
11
+ const workspaces = new devkit_1.Workspaces(context.workspaceRoot);
12
+ const workspaceConfig = workspaces.readWorkspaceConfiguration();
13
+ const p = workspaceConfig.projects[context.target.project];
14
+ const mfConfigPath = (0, path_1.join)(context.workspaceRoot, p.root, 'module-federation.config.js');
15
+ let mfeConfig;
16
+ try {
17
+ mfeConfig = require(mfConfigPath);
18
+ }
19
+ catch (_a) {
20
+ throw new Error(`Could not load ${mfConfigPath}. Was this project generated with "@nrwl/angular:host"?`);
21
+ }
22
+ const options = tslib_1.__rest(schema, []);
23
+ const unparsedRemotes = mfeConfig.remotes.length > 0 ? mfeConfig.remotes : [];
24
+ const remotes = unparsedRemotes.map((a) => (Array.isArray(a) ? a[0] : a));
25
+ for (const remote of remotes) {
26
+ (0, ngcli_adapter_1.scheduleTarget)(context.workspaceRoot, {
27
+ project: remote,
28
+ target: 'serve',
29
+ configuration: context.target.configuration,
30
+ runOptions: {},
31
+ executor: context.builder.builderName,
32
+ }, options.verbose);
33
+ }
34
+ return (0, webpack_server_impl_1.webpackServer)(options, context);
35
+ }
36
+ exports.moduleFederationDevServer = moduleFederationDevServer;
37
+ exports.default = (0, architect_1.createBuilder)(moduleFederationDevServer);
38
+ //# sourceMappingURL=module-federation-dev-server.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-federation-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts"],"names":[],"mappings":";;;;AACA,yCAA0C;AAC1C,gEAA8D;AAC9D,yDAA0E;AAE1E,+BAA4B;AAC5B,+EAAsE;AAEtE,SAAgB,yBAAyB,CACvC,MAAc,EACd,OAAuB;IAEvB,MAAM,UAAU,GAAG,IAAI,mBAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,UAAU,CAAC,0BAA0B,EAAE,CAAC;IAEhE,MAAM,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE3D,MAAM,YAAY,GAAG,IAAA,WAAI,EACvB,OAAO,CAAC,aAAa,EACrB,CAAC,CAAC,IAAI,EACN,6BAA6B,CAC9B,CAAC;IAEF,IAAI,SAAgC,CAAC;IACrC,IAAI;QACF,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;KACnC;IAAC,WAAM;QACN,MAAM,IAAI,KAAK,CACb,kBAAkB,YAAY,yDAAyD,CACxF,CAAC;KACH;IAED,MAAW,OAAO,kBAAK,MAAM,EAAvB,EAAc,CAAS,CAAC;IAC9B,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9E,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1E,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAA,8BAAc,EACZ,OAAO,CAAC,aAAa,EACrB;YACE,OAAO,EAAE,MAAM;YACf,MAAM,EAAE,OAAO;YACf,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa;YAC3C,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW;SACtC,EACD,OAAO,CAAC,OAAO,CAChB,CAAC;KACH;IAED,OAAO,IAAA,mCAAa,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AA3CD,8DA2CC;AAED,kBAAe,IAAA,yBAAa,EAAsB,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface Schema {
2
+ browserTarget: string;
3
+ port: number;
4
+ host: string;
5
+ proxyConfig?: string;
6
+ ssl: boolean;
7
+ sslKey?: string;
8
+ sslCert?: string;
9
+ headers?: Record<string, string>;
10
+ open: boolean;
11
+ verbose?: boolean;
12
+ liveReload: boolean;
13
+ publicHost?: string;
14
+ allowedHosts?: string[];
15
+ servePath?: string;
16
+ disableHostCheck?: boolean;
17
+ hmr?: boolean;
18
+ watch?: boolean;
19
+ poll?: number;
20
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Schema for Module Federation Dev Server",
4
+ "description": "The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host.",
5
+ "type": "object",
6
+ "presets": [
7
+ {
8
+ "name": "Using a Different Port",
9
+ "keys": ["browserTarget", "port"]
10
+ }
11
+ ],
12
+ "properties": {
13
+ "browserTarget": {
14
+ "type": "string",
15
+ "description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
16
+ "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
17
+ },
18
+ "port": {
19
+ "type": "number",
20
+ "description": "Port to listen on.",
21
+ "default": 4200
22
+ },
23
+ "host": {
24
+ "type": "string",
25
+ "description": "Host to listen on.",
26
+ "default": "localhost"
27
+ },
28
+ "proxyConfig": {
29
+ "type": "string",
30
+ "description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
31
+ },
32
+ "ssl": {
33
+ "type": "boolean",
34
+ "description": "Serve using HTTPS.",
35
+ "default": false
36
+ },
37
+ "sslKey": {
38
+ "type": "string",
39
+ "description": "SSL key to use for serving HTTPS."
40
+ },
41
+ "sslCert": {
42
+ "type": "string",
43
+ "description": "SSL certificate to use for serving HTTPS."
44
+ },
45
+ "headers": {
46
+ "type": "object",
47
+ "description": "Custom HTTP headers to be added to all responses.",
48
+ "propertyNames": {
49
+ "pattern": "^[-_A-Za-z0-9]+$"
50
+ },
51
+ "additionalProperties": {
52
+ "type": "string"
53
+ }
54
+ },
55
+ "open": {
56
+ "type": "boolean",
57
+ "description": "Opens the url in default browser.",
58
+ "default": false,
59
+ "alias": "o"
60
+ },
61
+ "verbose": {
62
+ "type": "boolean",
63
+ "description": "Adds more details to output logging."
64
+ },
65
+ "liveReload": {
66
+ "type": "boolean",
67
+ "description": "Whether to reload the page on change, using live-reload.",
68
+ "default": true
69
+ },
70
+ "publicHost": {
71
+ "type": "string",
72
+ "description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
73
+ },
74
+ "allowedHosts": {
75
+ "type": "array",
76
+ "description": "List of hosts that are allowed to access the dev server.",
77
+ "default": [],
78
+ "items": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ "servePath": {
83
+ "type": "string",
84
+ "description": "The pathname where the app will be served."
85
+ },
86
+ "disableHostCheck": {
87
+ "type": "boolean",
88
+ "description": "Don't verify connected clients are part of allowed hosts.",
89
+ "default": false
90
+ },
91
+ "hmr": {
92
+ "type": "boolean",
93
+ "description": "Enable hot module replacement.",
94
+ "default": false
95
+ },
96
+ "watch": {
97
+ "type": "boolean",
98
+ "description": "Rebuild on change.",
99
+ "default": true
100
+ },
101
+ "poll": {
102
+ "type": "number",
103
+ "description": "Enable and define the file watching poll time period in milliseconds."
104
+ }
105
+ },
106
+ "additionalProperties": false,
107
+ "required": ["browserTarget"]
108
+ }
@@ -1,11 +1,5 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
3
  "include": ["**/*.ts"],
4
- "compilerOptions": {
5
- "types": [
6
- <% if (unitTestRunner === 'jest') { %>"jest",<% } %>
7
- <% if (unitTestRunner === 'karma') { %>"jasmine",<% } %>
8
- "node"
9
- ]
10
- }
4
+ "compilerOptions": {}
11
5
  }
@@ -1,3 +1,3 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
2
  import type { NormalizedSchema } from './normalized-schema';
3
- export declare function updateEditorTsConfig(host: Tree, options: NormalizedSchema): void;
3
+ export declare function updateEditorTsConfig(tree: Tree, options: NormalizedSchema): void;
@@ -2,9 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateEditorTsConfig = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
- function updateEditorTsConfig(host, options) {
5
+ function getCompilerOptionsTypes(tsConfig) {
6
+ var _a, _b;
7
+ return (_b = (_a = tsConfig === null || tsConfig === void 0 ? void 0 : tsConfig.compilerOptions) === null || _a === void 0 ? void 0 : _a.types) !== null && _b !== void 0 ? _b : [];
8
+ }
9
+ function updateEditorTsConfig(tree, options) {
10
+ const types = getCompilerOptionsTypes((0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json')));
11
+ if (options.unitTestRunner !== 'none') {
12
+ types.concat(getCompilerOptionsTypes((0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.spec.json'))));
13
+ }
14
+ (0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.editor.json'), (json) => {
15
+ json.compilerOptions.types = types;
16
+ return json;
17
+ });
6
18
  // This should be the last tsconfig references so it's not in the template
7
- (0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'), (json) => {
19
+ (0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'), (json) => {
8
20
  json.references.push({
9
21
  path: './tsconfig.editor.json',
10
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"update-editor-tsconfig.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/update-editor-tsconfig.ts"],"names":[],"mappings":";;;AAGA,yCAA6D;AAE7D,SAAgB,oBAAoB,CAAC,IAAU,EAAE,OAAyB;IACxE,0EAA0E;IAC1E,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC,EAC1D,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACnB,IAAI,EAAE,wBAAwB;SAC/B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC,CACF,CAAC;AACJ,CAAC;AAZD,oDAYC"}
1
+ {"version":3,"file":"update-editor-tsconfig.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/update-editor-tsconfig.ts"],"names":[],"mappings":";;;AAGA,yCAAuE;AAMvE,SAAS,uBAAuB,CAAC,QAAkB;;IACjD,OAAO,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,eAAe,0CAAE,KAAK,mCAAI,EAAE,CAAC;AAChD,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAU,EAAE,OAAyB;IACxE,MAAM,KAAK,GAAG,uBAAuB,CACnC,IAAA,iBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAC/D,CACF,CAAC;IAEF,IAAI,OAAO,CAAC,cAAc,KAAK,MAAM,EAAE;QACrC,KAAK,CAAC,MAAM,CACV,uBAAuB,CACrB,IAAA,iBAAQ,EACN,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAChE,CACF,CACF,CAAC;KACH;IAED,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,sBAAsB,CAAC,EACjE,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC,CACF,CAAC;IAEF,0EAA0E;IAC1E,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC,EAC1D,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACnB,IAAI,EAAE,wBAAwB;SAC/B,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC,CACF,CAAC;AACJ,CAAC;AAvCD,oDAuCC"}
@@ -132,21 +132,21 @@
132
132
  "description": "Generate a Module Federation configuration for the application",
133
133
  "type": "boolean",
134
134
  "default": false,
135
- "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version."
135
+ "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
136
136
  },
137
137
  "mfeType": {
138
138
  "type": "string",
139
139
  "enum": ["host", "remote"],
140
140
  "description": "Type of application to generate the Module Federation configuration for.",
141
141
  "default": "remote",
142
- "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version."
142
+ "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
143
143
  },
144
144
  "federationType": {
145
145
  "type": "string",
146
146
  "enum": ["static", "dynamic"],
147
147
  "description": "Use either Static or Dynamic Module Federation pattern for the application.",
148
148
  "default": "static",
149
- "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version."
149
+ "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
150
150
  },
151
151
  "port": {
152
152
  "type": "number",
@@ -155,12 +155,12 @@
155
155
  "remotes": {
156
156
  "type": "array",
157
157
  "description": "A list of remote application names that the host application should consume.",
158
- "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version."
158
+ "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
159
159
  },
160
160
  "host": {
161
161
  "type": "string",
162
162
  "description": "The name of the host application that the remote application will be consumed by.",
163
- "x-deprecated": "Use the `mfe-host` or `mfe-remote` generators instead. Support for generating MFE applications using the application generator will be removed in an upcoming version."
163
+ "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
164
164
  },
165
165
  "setParserOptionsProject": {
166
166
  "type": "boolean",
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const devkit_2 = require("@nrwl/devkit");
6
- const get_mfe_projects_1 = require("../../utils/get-mfe-projects");
6
+ const get_mf_projects_1 = require("../../utils/get-mf-projects");
7
7
  const lib_1 = require("./lib");
8
8
  function convertToWithMF(tree, schema) {
9
9
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- const projects = new Set((0, get_mfe_projects_1.getMfeProjects)(tree, { legacy: true }));
10
+ const projects = new Set((0, get_mf_projects_1.getMFProjects)(tree, { legacy: true }));
11
11
  if (!projects.has(schema.project)) {
12
12
  throw new Error(`Could not find project "${schema.project}" with a Micro Frontend configuration in your workspace. Please check the name of the project you're wishing to convert exists.`);
13
13
  }
@@ -23,9 +23,9 @@ function convertToWithMF(tree, schema) {
23
23
  There are npm packages being shared with a custom configuration in webpack config (${pathToWebpackConfig}).`);
24
24
  }
25
25
  devkit_1.logger.warn(`This Micro Frontend configuration conversion will overwrite "${schema.project}"'s current webpack config. If you have anything custom that is not related to Micro Frontends, it will be lost. You should be able to see the changes in your version control system.`);
26
- const [updatedWebpackConfig, mfeConfig] = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
26
+ const [updatedWebpackConfig, mfConfig] = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
27
27
  tree.write(pathToWebpackConfig, updatedWebpackConfig);
28
- tree.write((0, devkit_1.joinPathFragments)(project.root, 'mfe.config.js'), mfeConfig);
28
+ tree.write((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js'), mfConfig);
29
29
  yield (0, devkit_2.formatFiles)(tree);
30
30
  });
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-with-mf.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAG/D,yCAAqE;AACrE,mEAA8D;AAC9D,+BAOe;AAEf,SAA8B,eAAe,CAAC,IAAU,EAAE,MAAc;;QACtE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAA,iCAAc,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAEjE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,iIAAiI,CAC3K,CAAC;SACH;QAED,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,mBAAmB,GAAG,IAAA,0BAAoB,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1E,MAAM,UAAU,GAAG,IAAA,6BAAuB,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,IAAA,uCAAiC,EAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;YAClE,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAC,OAAO;wCACb,mBAAmB,gCAAgC,CACtF,CAAC;SACH;QAED,IAAI,CAAC,IAAA,yCAAmC,EAAC,UAAU,CAAC,EAAE;YACpD,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAC,OAAO;6FACwC,mBAAmB,IAAI,CAC/G,CAAC;SACH;QAED,eAAM,CAAC,IAAI,CACT,gEAAgE,MAAM,CAAC,OAAO,wLAAwL,CACvQ,CAAC;QAEF,MAAM,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG,IAAA,2BAAqB,EAC7D,UAAU,EACV,IAAA,wBAAkB,EAAC,UAAU,CAAC,EAC9B,MAAM,CAAC,OAAO,CACf,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,SAAS,CAAC,CAAC;QAExE,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAxCD,kCAwCC"}
1
+ {"version":3,"file":"convert-to-with-mf.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/convert-to-with-mf/convert-to-with-mf.ts"],"names":[],"mappings":";;;AAAA,yCAA+D;AAG/D,yCAAqE;AACrE,iEAA4D;AAC5D,+BAOe;AAEf,SAA8B,eAAe,CAAC,IAAU,EAAE,MAAc;;QACtE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAA,+BAAa,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAEhE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACjC,MAAM,IAAI,KAAK,CACb,2BAA2B,MAAM,CAAC,OAAO,iIAAiI,CAC3K,CAAC;SACH;QAED,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/D,MAAM,mBAAmB,GAAG,IAAA,0BAAoB,EAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1E,MAAM,UAAU,GAAG,IAAA,6BAAuB,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QAEtE,IAAI,CAAC,IAAA,uCAAiC,EAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE;YAClE,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAC,OAAO;wCACb,mBAAmB,gCAAgC,CACtF,CAAC;SACH;QAED,IAAI,CAAC,IAAA,yCAAmC,EAAC,UAAU,CAAC,EAAE;YACpD,MAAM,IAAI,KAAK,CACb,iCAAiC,MAAM,CAAC,OAAO;6FACwC,mBAAmB,IAAI,CAC/G,CAAC;SACH;QAED,eAAM,CAAC,IAAI,CACT,gEAAgE,MAAM,CAAC,OAAO,wLAAwL,CACvQ,CAAC;QAEF,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAAG,IAAA,2BAAqB,EAC5D,UAAU,EACV,IAAA,wBAAkB,EAAC,UAAU,CAAC,EAC9B,MAAM,CAAC,OAAO,CACf,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,CACR,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,6BAA6B,CAAC,EAC9D,QAAQ,CACT,CAAC;QAEF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA3CD,kCA2CC"}
@@ -4,7 +4,7 @@ exports.writeNewWebpackConfig = void 0;
4
4
  const is_host_remote_config_1 = require("./is-host-remote-config");
5
5
  function writeNewWebpackConfig(ast, mfType, projectName) {
6
6
  const webpackConfig = `const { withModuleFederation } = require('@nrwl/angular/module-federation');
7
- const config = require('./mfe.config');
7
+ const config = require('./module-federation.config');
8
8
  module.exports = withModuleFederation(config);`;
9
9
  let mfeConfig = '';
10
10
  if (!mfType) {
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const devkit_1 = require("@nrwl/devkit");
4
+ const host_1 = require("./host");
5
+ exports.default = (0, devkit_1.convertNxGenerator)(host_1.default);
6
+ //# sourceMappingURL=host.compat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.compat.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/host/host.compat.ts"],"names":[],"mappings":";;AAAA,yCAAkD;AAClD,iCAA0B;AAE1B,kBAAe,IAAA,2BAAkB,EAAC,cAAI,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nrwl/devkit';
2
+ import type { Schema } from './schema';
3
+ export default function host(tree: Tree, options: Schema): Promise<() => void>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nrwl/devkit");
5
+ const devkit_2 = require("@nrwl/devkit");
6
+ const application_1 = require("../application/application");
7
+ const remote_1 = require("../remote/remote");
8
+ function host(tree, options) {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
+ const projects = (0, devkit_2.getProjects)(tree);
11
+ const remotesToGenerate = [];
12
+ const remotesToIntegrate = [];
13
+ if (options.remotes && options.remotes.length > 0) {
14
+ options.remotes.forEach((remote) => {
15
+ if (!projects.has(remote)) {
16
+ remotesToGenerate.push(remote);
17
+ }
18
+ else {
19
+ remotesToIntegrate.push(remote);
20
+ }
21
+ });
22
+ }
23
+ const installTask = yield (0, application_1.default)(tree, Object.assign(Object.assign({}, options), { mfe: true, mfeType: 'host', routing: true, remotes: remotesToIntegrate !== null && remotesToIntegrate !== void 0 ? remotesToIntegrate : [], port: 4200, federationType: options.dynamic ? 'dynamic' : 'static', skipFormat: true }));
24
+ for (const remote of remotesToGenerate) {
25
+ yield (0, remote_1.default)(tree, Object.assign(Object.assign({}, options), { name: remote, host: (0, devkit_1.names)(options.name).fileName, skipFormat: true }));
26
+ }
27
+ if (!options.skipFormat) {
28
+ yield (0, devkit_1.formatFiles)(tree);
29
+ }
30
+ return installTask;
31
+ });
32
+ }
33
+ exports.default = host;
34
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/host/host.ts"],"names":[],"mappings":";;;AAAA,yCAAwD;AAGxD,yCAA2C;AAC3C,4DAA8D;AAC9D,6CAA+C;AAE/C,SAA8B,IAAI,CAAC,IAAU,EAAE,OAAe;;QAC5D,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,MAAM,iBAAiB,GAAa,EAAE,CAAC;QACvC,MAAM,kBAAkB,GAAa,EAAE,CAAC;QAExC,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACjD,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;gBACjC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;oBACzB,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBAChC;qBAAM;oBACL,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBACjC;YACH,CAAC,CAAC,CAAC;SACJ;QAED,MAAM,WAAW,GAAG,MAAM,IAAA,qBAAoB,EAAC,IAAI,kCAC9C,OAAO,KACV,GAAG,EAAE,IAAI,EACT,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,kBAAkB,aAAlB,kBAAkB,cAAlB,kBAAkB,GAAI,EAAE,EACjC,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACtD,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE;YACtC,MAAM,IAAA,gBAAe,EAAC,IAAI,kCACrB,OAAO,KACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAClC,UAAU,EAAE,IAAI,IAChB,CAAC;SACJ;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AAzCD,uBAyCC"}
File without changes
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
- "$id": "NxMFEHost",
3
+ "$id": "NxMFHost",
4
4
  "cli": "nx",
5
- "title": "Nx MFE Host Application",
6
- "description": "Create an Angular Host Micro Frontend Application.",
5
+ "title": "Nx Module Federation Host Application",
6
+ "description": "Create an Angular Host Module Federation Application.",
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "nx g @nrwl/angular:mfe-host appName --remotes=remote1",
11
- "description": "Create an Angular application with configuration in place for MFE. If the `remotes` option is provided, attach the remote application to this application's configuration"
10
+ "command": "nx g @nrwl/angular:host appName --remotes=remote1",
11
+ "description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the remote application to this application's configuration"
12
12
  }
13
13
  ],
14
14
  "properties": {
@@ -21,6 +21,7 @@ function karmaGenerator(tree, options) {
21
21
  'jasmine-core': '~3.10.0',
22
22
  'jasmine-spec-reporter': '~5.0.0',
23
23
  '@types/jasmine': '~3.5.0',
24
+ '@types/node': '16.11.7',
24
25
  });
25
26
  }
26
27
  exports.karmaGenerator = karmaGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"karma.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/karma/karma.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAGtB,SAAgB,cAAc,CAAC,IAAU,EAAE,OAAyB;IAClE,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;QACjC,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE;YAC9D,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;KACJ;IAED,IAAI,OAAO,CAAC,eAAe,IAAI,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE;QACnE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;KACjB;IACD,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,EACF;QACE,KAAK,EAAE,QAAQ;QACf,uBAAuB,EAAE,QAAQ;QACjC,gBAAgB,EAAE,QAAQ;QAC1B,eAAe,EAAE,QAAQ;QACzB,6BAA6B,EAAE,QAAQ;QACvC,cAAc,EAAE,SAAS;QACzB,uBAAuB,EAAE,QAAQ;QACjC,gBAAgB,EAAE,QAAQ;KAC3B,CACF,CAAC;AACJ,CAAC;AA1BD,wCA0BC;AAED,kBAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"karma.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/karma/karma.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AAGtB,SAAgB,cAAc,CAAC,IAAU,EAAE,OAAyB;IAClE,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;QACjC,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE;YAC9D,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;KACJ;IAED,IAAI,OAAO,CAAC,eAAe,IAAI,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE;QACnE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;KACjB;IACD,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ,EAAE,EACF;QACE,KAAK,EAAE,QAAQ;QACf,uBAAuB,EAAE,QAAQ;QACjC,gBAAgB,EAAE,QAAQ;QAC1B,eAAe,EAAE,QAAQ;QACzB,6BAA6B,EAAE,QAAQ;QACvC,cAAc,EAAE,SAAS;QACzB,uBAAuB,EAAE,QAAQ;QACjC,gBAAgB,EAAE,QAAQ;QAC1B,aAAa,EAAE,SAAS;KACzB,CACF,CAAC;AACJ,CAAC;AA3BD,wCA2BC;AAED,kBAAe,cAAc,CAAC"}