@nx/angular 24.0.0-beta.2 → 24.0.0-beta.3

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 (187) hide show
  1. package/dist/executors.d.ts +0 -2
  2. package/dist/executors.js +0 -2
  3. package/dist/generators.d.ts +0 -4
  4. package/dist/generators.js +0 -4
  5. package/dist/src/generators/add-linting/add-linting.js +0 -2
  6. package/dist/src/generators/add-linting/schema.d.ts +0 -1
  7. package/dist/src/generators/application/application.js +1 -2
  8. package/dist/src/generators/application/lib/add-e2e.js +0 -6
  9. package/dist/src/generators/application/lib/add-linting.js +0 -1
  10. package/dist/src/generators/application/lib/add-unit-test-runner.js +0 -2
  11. package/dist/src/generators/application/lib/normalize-options.d.ts +1 -1
  12. package/dist/src/generators/application/lib/normalize-options.js +1 -8
  13. package/dist/src/generators/application/schema.d.ts +0 -1
  14. package/dist/src/generators/application/schema.json +1 -1
  15. package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +3 -4
  16. package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +1 -2
  17. package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +0 -63
  18. package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.d.ts +2 -0
  19. package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.js +32 -0
  20. package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -15
  21. package/dist/src/generators/init/init.js +1 -2
  22. package/dist/src/generators/init/schema.d.ts +0 -2
  23. package/dist/src/generators/library/schema.d.ts +0 -1
  24. package/dist/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +12 -1
  25. package/dist/src/generators/ng-add/migrators/projects/e2e.migrator.js +12 -16
  26. package/dist/src/generators/ng-add/utilities/workspace.js +1 -3
  27. package/dist/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
  28. package/dist/src/generators/utils/add-jest.d.ts +0 -1
  29. package/dist/src/generators/utils/add-jest.js +0 -2
  30. package/dist/src/generators/utils/add-vitest.d.ts +0 -1
  31. package/dist/src/generators/utils/add-vitest.js +0 -1
  32. package/dist/src/generators/utils/testing.d.ts +0 -4
  33. package/dist/src/generators/utils/testing.js +0 -12
  34. package/dist/src/utils/backward-compatible-versions.js +0 -8
  35. package/dist/src/utils/versions.d.ts +0 -4
  36. package/dist/src/utils/versions.js +1 -5
  37. package/executors.json +0 -10
  38. package/generators.json +0 -35
  39. package/package.json +11 -20
  40. package/dist/.npmignore +0 -2
  41. package/dist/fesm2022/nx-angular-mf.mjs +0 -193
  42. package/dist/fesm2022/nx-angular-mf.mjs.map +0 -1
  43. package/dist/mf/package.json +0 -4
  44. package/dist/src/builders/utilities/module-federation.d.ts +0 -11
  45. package/dist/src/builders/utilities/module-federation.js +0 -109
  46. package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
  47. package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
  48. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
  49. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -22
  50. package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -5
  51. package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
  52. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
  53. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -111
  54. package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -38
  55. package/dist/src/executors/module-federation-dev-server/schema.json +0 -171
  56. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -2
  57. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -20
  58. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.d.ts +0 -5
  59. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.js +0 -30
  60. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -4
  61. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -110
  62. package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -17
  63. package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -124
  64. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +0 -4
  65. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.js +0 -36
  66. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +0 -5
  67. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +0 -448
  68. package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +0 -2
  69. package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.js +0 -22
  70. package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +0 -2
  71. package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +0 -45
  72. package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +0 -2
  73. package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +0 -18
  74. package/dist/src/generators/convert-to-with-mf/lib/index.d.ts +0 -6
  75. package/dist/src/generators/convert-to-with-mf/lib/index.js +0 -9
  76. package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +0 -5
  77. package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +0 -57
  78. package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +0 -2
  79. package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +0 -13
  80. package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +0 -3
  81. package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +0 -50
  82. package/dist/src/generators/convert-to-with-mf/schema.d.ts +0 -4
  83. package/dist/src/generators/convert-to-with-mf/schema.json +0 -33
  84. package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
  85. package/dist/src/generators/federate-module/federate-module.js +0 -49
  86. package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +0 -2
  87. package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +0 -14
  88. package/dist/src/generators/federate-module/lib/add-path-to-exposes.d.ts +0 -8
  89. package/dist/src/generators/federate-module/lib/add-path-to-exposes.js +0 -77
  90. package/dist/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +0 -8
  91. package/dist/src/generators/federate-module/lib/add-path-to-ts-config.js +0 -11
  92. package/dist/src/generators/federate-module/lib/add-remote.d.ts +0 -7
  93. package/dist/src/generators/federate-module/lib/add-remote.js +0 -42
  94. package/dist/src/generators/federate-module/lib/check-remote-exists.d.ts +0 -2
  95. package/dist/src/generators/federate-module/lib/check-remote-exists.js +0 -21
  96. package/dist/src/generators/federate-module/lib/index.d.ts +0 -4
  97. package/dist/src/generators/federate-module/lib/index.js +0 -7
  98. package/dist/src/generators/federate-module/schema.d.ts +0 -13
  99. package/dist/src/generators/federate-module/schema.json +0 -83
  100. package/dist/src/generators/host/files/common/src/main.server.ts__tmpl__ +0 -78
  101. package/dist/src/generators/host/files/js/webpack.server.config.js__tmpl__ +0 -8
  102. package/dist/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +0 -9
  103. package/dist/src/generators/host/host.d.ts +0 -4
  104. package/dist/src/generators/host/host.js +0 -133
  105. package/dist/src/generators/host/lib/index.d.ts +0 -2
  106. package/dist/src/generators/host/lib/index.js +0 -5
  107. package/dist/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
  108. package/dist/src/generators/host/lib/update-ssr-setup.js +0 -54
  109. package/dist/src/generators/host/lib/validate-options.d.ts +0 -3
  110. package/dist/src/generators/host/lib/validate-options.js +0 -12
  111. package/dist/src/generators/host/schema.d.ts +0 -36
  112. package/dist/src/generators/host/schema.json +0 -195
  113. package/dist/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +0 -9
  114. package/dist/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +0 -9
  115. package/dist/src/generators/remote/files/common/src/main.server.ts__tmpl__ +0 -84
  116. package/dist/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +0 -12
  117. package/dist/src/generators/remote/lib/find-next-available-port.d.ts +0 -2
  118. package/dist/src/generators/remote/lib/find-next-available-port.js +0 -16
  119. package/dist/src/generators/remote/lib/index.d.ts +0 -3
  120. package/dist/src/generators/remote/lib/index.js +0 -6
  121. package/dist/src/generators/remote/lib/update-ssr-setup.d.ts +0 -9
  122. package/dist/src/generators/remote/lib/update-ssr-setup.js +0 -82
  123. package/dist/src/generators/remote/lib/validate-options.d.ts +0 -3
  124. package/dist/src/generators/remote/lib/validate-options.js +0 -12
  125. package/dist/src/generators/remote/remote.d.ts +0 -4
  126. package/dist/src/generators/remote/remote.js +0 -114
  127. package/dist/src/generators/remote/schema.d.ts +0 -34
  128. package/dist/src/generators/remote/schema.json +0 -184
  129. package/dist/src/generators/setup-mf/files/entry-module-files/__entryModuleFileName__.ts__tmpl__ +0 -18
  130. package/dist/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +0 -4
  131. package/dist/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +0 -10
  132. package/dist/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -42
  133. package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +0 -4
  134. package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +0 -11
  135. package/dist/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -27
  136. package/dist/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
  137. package/dist/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +0 -9
  138. package/dist/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +0 -21
  139. package/dist/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +0 -23
  140. package/dist/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +0 -9
  141. package/dist/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +0 -21
  142. package/dist/src/generators/setup-mf/lib/add-cypress-workaround.d.ts +0 -3
  143. package/dist/src/generators/setup-mf/lib/add-cypress-workaround.js +0 -52
  144. package/dist/src/generators/setup-mf/lib/add-remote-entry.d.ts +0 -3
  145. package/dist/src/generators/setup-mf/lib/add-remote-entry.js +0 -27
  146. package/dist/src/generators/setup-mf/lib/add-remote-to-host.d.ts +0 -9
  147. package/dist/src/generators/setup-mf/lib/add-remote-to-host.js +0 -127
  148. package/dist/src/generators/setup-mf/lib/change-build-target.d.ts +0 -3
  149. package/dist/src/generators/setup-mf/lib/change-build-target.js +0 -24
  150. package/dist/src/generators/setup-mf/lib/fix-bootstrap.d.ts +0 -3
  151. package/dist/src/generators/setup-mf/lib/fix-bootstrap.js +0 -40
  152. package/dist/src/generators/setup-mf/lib/generate-config.d.ts +0 -6
  153. package/dist/src/generators/setup-mf/lib/generate-config.js +0 -32
  154. package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.d.ts +0 -6
  155. package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.js +0 -20
  156. package/dist/src/generators/setup-mf/lib/index.d.ts +0 -15
  157. package/dist/src/generators/setup-mf/lib/index.js +0 -18
  158. package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.d.ts +0 -2
  159. package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.js +0 -15
  160. package/dist/src/generators/setup-mf/lib/normalize-options.d.ts +0 -3
  161. package/dist/src/generators/setup-mf/lib/normalize-options.js +0 -26
  162. package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +0 -3
  163. package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +0 -61
  164. package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.d.ts +0 -3
  165. package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.js +0 -20
  166. package/dist/src/generators/setup-mf/lib/setup-serve-target.d.ts +0 -3
  167. package/dist/src/generators/setup-mf/lib/setup-serve-target.js +0 -39
  168. package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +0 -3
  169. package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.js +0 -15
  170. package/dist/src/generators/setup-mf/lib/update-host-app-routes.d.ts +0 -3
  171. package/dist/src/generators/setup-mf/lib/update-host-app-routes.js +0 -39
  172. package/dist/src/generators/setup-mf/lib/update-tsconfig.d.ts +0 -3
  173. package/dist/src/generators/setup-mf/lib/update-tsconfig.js +0 -18
  174. package/dist/src/generators/setup-mf/schema.d.ts +0 -35
  175. package/dist/src/generators/setup-mf/schema.json +0 -99
  176. package/dist/src/generators/setup-mf/setup-mf.d.ts +0 -4
  177. package/dist/src/generators/setup-mf/setup-mf.js +0 -90
  178. package/dist/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
  179. package/dist/src/generators/utils/add-mf-env-to-inputs.js +0 -36
  180. package/dist/src/generators/utils/assert-mf-utils.d.ts +0 -1
  181. package/dist/src/generators/utils/assert-mf-utils.js +0 -8
  182. package/dist/src/utils/get-mf-projects.d.ts +0 -4
  183. package/dist/src/utils/get-mf-projects.js +0 -31
  184. package/dist/src/utils/module-federation-deprecation.d.ts +0 -4
  185. package/dist/src/utils/module-federation-deprecation.js +0 -29
  186. package/dist/types/nx-angular-mf.d.ts +0 -72
  187. package/dist/types/nx-angular-mf.d.ts.map +0 -1
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateTestApplication = generateTestApplication;
4
- exports.generateTestHostApplication = generateTestHostApplication;
5
- exports.generateTestRemoteApplication = generateTestRemoteApplication;
6
4
  exports.generateTestLibrary = generateTestLibrary;
7
5
  exports.createStorybookTestWorkspaceForLib = createStorybookTestWorkspaceForLib;
8
6
  const devkit_1 = require("@nx/devkit");
@@ -11,23 +9,13 @@ const internal_1 = require("@nx/js/internal");
11
9
  const test_runners_1 = require("../../utils/test-runners");
12
10
  const application_1 = require("../application/application");
13
11
  const component_1 = require("../component/component");
14
- const host_1 = require("../host/host");
15
12
  const library_1 = require("../library/library");
16
- const remote_1 = require("../remote/remote");
17
13
  async function generateTestApplication(tree, options) {
18
14
  tree.write('.gitignore', '');
19
15
  await (0, application_1.applicationGenerator)(tree, {
20
16
  ...options,
21
17
  });
22
18
  }
23
- async function generateTestHostApplication(tree, options) {
24
- tree.write('.gitignore', '');
25
- await (0, host_1.host)(tree, { ...options });
26
- }
27
- async function generateTestRemoteApplication(tree, options) {
28
- tree.write('.gitignore', '');
29
- await (0, remote_1.remote)(tree, { ...options });
30
- }
31
19
  async function generateTestLibrary(tree, options) {
32
20
  tree.write('.gitignore', '');
33
21
  await (0, library_1.libraryGenerator)(tree, {
@@ -14,13 +14,9 @@ exports.backwardCompatibleVersions = {
14
14
  rxjsVersion: '~7.8.0',
15
15
  zoneJsVersion: '~0.16.0',
16
16
  tsLibVersion: '^2.3.0',
17
- corsVersion: '~2.8.5',
18
- typesCorsVersion: '~2.8.5',
19
17
  expressVersion: '^4.21.2',
20
18
  typesExpressVersion: '^4.17.21',
21
19
  browserSyncVersion: '^3.0.0',
22
- moduleFederationNodeVersion: '^2.7.21',
23
- moduleFederationEnhancedVersion: '^2.1.0',
24
20
  angularEslintVersion: '^21.2.0',
25
21
  typescriptEslintVersion: '^7.16.0',
26
22
  postcssVersion: '^8.4.5',
@@ -45,13 +41,9 @@ exports.backwardCompatibleVersions = {
45
41
  rxjsVersion: '~7.8.0',
46
42
  zoneJsVersion: '~0.15.0',
47
43
  tsLibVersion: '^2.3.0',
48
- corsVersion: '~2.8.5',
49
- typesCorsVersion: '~2.8.5',
50
44
  expressVersion: '^4.21.2',
51
45
  typesExpressVersion: '^4.17.21',
52
46
  browserSyncVersion: '^3.0.0',
53
- moduleFederationNodeVersion: '^2.7.21',
54
- moduleFederationEnhancedVersion: '^0.21.2',
55
47
  angularEslintVersion: '^20.3.0',
56
48
  typescriptEslintVersion: '^8.40.0',
57
49
  postcssVersion: '^8.4.5',
@@ -6,13 +6,9 @@ export declare const ngrxVersion = "^22.0.0";
6
6
  export declare const rxjsVersion = "~7.8.0";
7
7
  export declare const zoneJsVersion = "~0.16.2";
8
8
  export declare const tsLibVersion = "^2.3.0";
9
- export declare const corsVersion = "~2.8.5";
10
- export declare const typesCorsVersion = "~2.8.5";
11
9
  export declare const expressVersion = "^4.21.2";
12
10
  export declare const typesExpressVersion = "^4.17.21";
13
11
  export declare const browserSyncVersion = "^3.0.0";
14
- export declare const moduleFederationNodeVersion = "^2.7.21";
15
- export declare const moduleFederationEnhancedVersion = "^2.1.0";
16
12
  export declare const webpackMergeVersion = "^5.8.0";
17
13
  export declare const angularEslintVersion = "^22.1.0";
18
14
  export declare const typescriptEslintVersion = "^8.40.0";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
3
+ exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.tsLibVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.nxVersion = require((0, path_1.join)('@nx/angular', 'package.json')).version;
6
6
  exports.angularVersion = '~22.1.0';
@@ -10,13 +10,9 @@ exports.ngrxVersion = '^22.0.0';
10
10
  exports.rxjsVersion = '~7.8.0';
11
11
  exports.zoneJsVersion = '~0.16.2';
12
12
  exports.tsLibVersion = '^2.3.0';
13
- exports.corsVersion = '~2.8.5';
14
- exports.typesCorsVersion = '~2.8.5';
15
13
  exports.expressVersion = '^4.21.2';
16
14
  exports.typesExpressVersion = '^4.17.21';
17
15
  exports.browserSyncVersion = '^3.0.0';
18
- exports.moduleFederationNodeVersion = '^2.7.21';
19
- exports.moduleFederationEnhancedVersion = '^2.1.0';
20
16
  exports.webpackMergeVersion = '^5.8.0';
21
17
  exports.angularEslintVersion = '^22.1.0';
22
18
  exports.typescriptEslintVersion = '^8.40.0';
package/executors.json CHANGED
@@ -20,16 +20,6 @@
20
20
  "schema": "./dist/src/executors/browser-esbuild/schema.json",
21
21
  "description": "Builds an Angular application using [esbuild](https://esbuild.github.io/)."
22
22
  },
23
- "module-federation-dev-server": {
24
- "implementation": "./dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl",
25
- "schema": "./dist/src/executors/module-federation-dev-server/schema.json",
26
- "description": "Serves host [Module Federation](https://module-federation.io/) applications ([webpack](https://webpack.js.org/)-based) allowing to specify which remote applications should be served with the host."
27
- },
28
- "module-federation-dev-ssr": {
29
- "implementation": "./dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl",
30
- "schema": "./dist/src/executors/module-federation-ssr-dev-server/schema.json",
31
- "description": "The module-federation-ssr-dev-server executor is reserved exclusively for use with host SSR Module Federation applications. It allows the user to specify which remote applications should be served with the host."
32
- },
33
23
  "application": {
34
24
  "implementation": "./dist/src/executors/application/application.impl",
35
25
  "schema": "./dist/src/executors/application/schema.json",
package/generators.json CHANGED
@@ -49,13 +49,6 @@
49
49
  "aliases": ["d"],
50
50
  "description": "Generate an Angular directive."
51
51
  },
52
- "federate-module": {
53
- "factory": "./dist/src/generators/federate-module/federate-module",
54
- "schema": "./dist/src/generators/federate-module/schema.json",
55
- "x-type": "application",
56
- "description": "Create a federated module, which is exposed by a remote and can be subsequently loaded by a host.",
57
- "x-deprecated": "Angular Module Federation in Nx is no longer supported. Use `@angular-architects/native-federation` instead. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide. Removed in Nx v24."
58
- },
59
52
  "init": {
60
53
  "factory": "./dist/src/generators/init/init",
61
54
  "schema": "./dist/src/generators/init/schema.json",
@@ -75,28 +68,6 @@
75
68
  "aliases": ["secondary-entry-point", "entry-point"],
76
69
  "description": "Creates a secondary entry point for an Angular publishable library."
77
70
  },
78
- "remote": {
79
- "factory": "./dist/src/generators/remote/remote",
80
- "schema": "./dist/src/generators/remote/schema.json",
81
- "x-type": "application",
82
- "description": "Generate a Remote Angular Module Federation Application.",
83
- "aliases": ["producer"],
84
- "x-deprecated": "Angular Module Federation in Nx is no longer supported. Use `@angular-architects/native-federation` instead. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide. Removed in Nx v24."
85
- },
86
- "convert-to-with-mf": {
87
- "factory": "./dist/src/generators/convert-to-with-mf/convert-to-with-mf",
88
- "schema": "./dist/src/generators/convert-to-with-mf/schema.json",
89
- "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{% callout type=\"warning\" title=\"Overrides\" %}This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!{% /callout %}",
90
- "x-deprecated": "Angular Module Federation in Nx is no longer supported. Use `@angular-architects/native-federation` instead. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide. Removed in Nx v24."
91
- },
92
- "host": {
93
- "factory": "./dist/src/generators/host/host",
94
- "schema": "./dist/src/generators/host/schema.json",
95
- "x-type": "application",
96
- "description": "Generate a Host Angular Module Federation Application.",
97
- "aliases": ["consumer"],
98
- "x-deprecated": "Angular Module Federation in Nx is no longer supported. Use `@angular-architects/native-federation` instead. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide. Removed in Nx v24."
99
- },
100
71
  "ng-add": {
101
72
  "factory": "./dist/src/generators/ng-add/ng-add",
102
73
  "schema": "./dist/src/generators/ng-add/schema.json",
@@ -143,12 +114,6 @@
143
114
  "description": "Generate a pipe with an accompanying Single Component Angular Module (SCAM).",
144
115
  "x-deprecated": "SCAMs are superseded by Angular standalone components. Use the `@nx/angular:pipe` generator instead. It will be removed in Nx v24."
145
116
  },
146
- "setup-mf": {
147
- "factory": "./dist/src/generators/setup-mf/setup-mf",
148
- "schema": "./dist/src/generators/setup-mf/schema.json",
149
- "description": "Generate a Module Federation configuration for a given Angular application.",
150
- "x-deprecated": "Angular Module Federation in Nx is no longer supported. Use `@angular-architects/native-federation` instead. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide. Removed in Nx v24."
151
- },
152
117
  "setup-ssr": {
153
118
  "factory": "./dist/src/generators/setup-ssr/setup-ssr",
154
119
  "schema": "./dist/src/generators/setup-ssr/schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "24.0.0-beta.2",
3
+ "version": "24.0.0-beta.3",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "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, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
@@ -32,10 +32,6 @@
32
32
  "types": "./dist/types/nx-angular.d.ts",
33
33
  "default": "./dist/fesm2022/nx-angular.mjs"
34
34
  },
35
- "./mf": {
36
- "types": "./dist/types/nx-angular-mf.d.ts",
37
- "default": "./dist/fesm2022/nx-angular-mf.mjs"
38
- },
39
35
  "./package.json": {
40
36
  "default": "./package.json"
41
37
  },
@@ -71,10 +67,9 @@
71
67
  "supportsOptionalMigrations": true
72
68
  },
73
69
  "dependencies": {
74
- "@nx/devkit": "24.0.0-beta.2",
75
- "@nx/eslint": "24.0.0-beta.2",
76
- "@nx/js": "24.0.0-beta.2",
77
- "@nx/web": "24.0.0-beta.2",
70
+ "@nx/devkit": "24.0.0-beta.3",
71
+ "@nx/eslint": "24.0.0-beta.3",
72
+ "@nx/js": "24.0.0-beta.3",
78
73
  "@phenomnomnominal/tsquery": "~6.2.0",
79
74
  "@typescript-eslint/type-utils": "^8.0.0",
80
75
  "jsonc-parser": "^3.2.0",
@@ -85,21 +80,20 @@
85
80
  "tslib": "^2.3.0"
86
81
  },
87
82
  "devDependencies": {
88
- "@nx/storybook": "24.0.0-beta.2",
89
- "@nx/vitest": "24.0.0-beta.2",
90
- "nx": "24.0.0-beta.2"
83
+ "@nx/storybook": "24.0.0-beta.3",
84
+ "@nx/vitest": "24.0.0-beta.3",
85
+ "nx": "24.0.0-beta.3"
91
86
  },
92
87
  "peerDependencies": {
93
88
  "@angular/build": ">= 20.0.0 < 23.0.0",
94
89
  "@angular-devkit/build-angular": ">= 20.0.0 < 23.0.0",
95
90
  "@angular-devkit/core": ">= 20.0.0 < 23.0.0",
96
91
  "@angular-devkit/schematics": ">= 20.0.0 < 23.0.0",
97
- "@nx/cypress": "24.0.0-beta.2",
98
- "@nx/playwright": "24.0.0-beta.2",
92
+ "@nx/cypress": "24.0.0-beta.3",
93
+ "@nx/playwright": "24.0.0-beta.3",
99
94
  "@schematics/angular": ">= 20.0.0 < 23.0.0",
100
- "@nx/module-federation": "24.0.0-beta.2",
101
- "@nx/rspack": "24.0.0-beta.2",
102
- "@nx/webpack": "24.0.0-beta.2",
95
+ "@nx/rspack": "24.0.0-beta.3",
96
+ "@nx/webpack": "24.0.0-beta.3",
103
97
  "ng-packagr": ">= 20.0.0 < 23.0.0",
104
98
  "rxjs": "^6.5.3 || ^7.5.0",
105
99
  "webpack-merge": "^5.8.0"
@@ -117,9 +111,6 @@
117
111
  "@nx/playwright": {
118
112
  "optional": true
119
113
  },
120
- "@nx/module-federation": {
121
- "optional": true
122
- },
123
114
  "@nx/rspack": {
124
115
  "optional": true
125
116
  },
package/dist/.npmignore DELETED
@@ -1,2 +0,0 @@
1
- # Nested package.json's are only needed for development.
2
- mf/package.json
@@ -1,193 +0,0 @@
1
- // Helper function to extract file extension from a path
2
- function extname(path) {
3
- const lastDot = path.lastIndexOf('.');
4
- const lastSlash = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
5
- if (lastDot === -1 || lastDot < lastSlash) {
6
- return '';
7
- }
8
- return path.slice(lastDot);
9
- }
10
- /**
11
- * Checks if a URL string is absolute (has protocol)
12
- */
13
- function isAbsoluteUrl(url) {
14
- try {
15
- new URL(url);
16
- return true;
17
- }
18
- catch {
19
- return false;
20
- }
21
- }
22
- /**
23
- * Safely processes remote locations, handling both relative and absolute URLs
24
- * while preserving query parameters and hash fragments for absolute URLs
25
- */
26
- function processRemoteLocation(remoteLocation, remoteEntryExt) {
27
- // Handle promise-based remotes as-is
28
- if (remoteLocation.startsWith('promise new Promise')) {
29
- return remoteLocation;
30
- }
31
- if (isAbsoluteUrl(remoteLocation)) {
32
- // Use new URL parsing for absolute URLs (supports query params/hash)
33
- const url = new URL(remoteLocation);
34
- const ext = extname(url.pathname);
35
- const needsRemoteEntry = !['.js', '.mjs', '.json'].includes(ext);
36
- if (needsRemoteEntry) {
37
- url.pathname = url.pathname.endsWith('/')
38
- ? `${url.pathname}remoteEntry.${remoteEntryExt}`
39
- : `${url.pathname}/remoteEntry.${remoteEntryExt}`;
40
- }
41
- return url.href;
42
- }
43
- else {
44
- // Use string manipulation for relative URLs (backward compatibility)
45
- const ext = extname(remoteLocation);
46
- const needsRemoteEntry = !['.js', '.mjs', '.json'].includes(ext);
47
- if (needsRemoteEntry) {
48
- const baseRemote = remoteLocation.endsWith('/')
49
- ? remoteLocation.slice(0, -1)
50
- : remoteLocation;
51
- return `${baseRemote}/remoteEntry.${remoteEntryExt}`;
52
- }
53
- return remoteLocation;
54
- }
55
- }
56
- /**
57
- * Processes remote URLs for runtime environments, resolving relative URLs against window.location.origin
58
- */
59
- function processRuntimeRemoteUrl(remoteUrl, remoteEntryExt) {
60
- if (isAbsoluteUrl(remoteUrl)) {
61
- return processRemoteLocation(remoteUrl, remoteEntryExt);
62
- }
63
- else {
64
- // For runtime relative URLs, resolve against current origin
65
- const baseUrl = typeof globalThis !== 'undefined' &&
66
- typeof globalThis.window !== 'undefined' &&
67
- globalThis.window.location
68
- ? globalThis.window.location.origin
69
- : 'http://localhost';
70
- const absoluteUrl = new URL(remoteUrl, baseUrl).href;
71
- return processRemoteLocation(absoluteUrl, remoteEntryExt);
72
- }
73
- }
74
-
75
- let resolveRemoteUrl;
76
- /**
77
- * @deprecated Use Runtime Helpers from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
78
- */
79
- function setRemoteUrlResolver(_resolveRemoteUrl) {
80
- resolveRemoteUrl = _resolveRemoteUrl;
81
- }
82
- let remoteUrlDefinitions;
83
- /**
84
- * @deprecated Use init() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
85
- * If you have a remote app called `my-remote-app` and you want to use the `http://localhost:4201/mf-manifest.json` as the remote url, you should change it from:
86
- * ```ts
87
- * import { setRemoteDefinitions } from '@nx/angular/mf';
88
- *
89
- * setRemoteDefinitions({
90
- * 'my-remote-app': 'http://localhost:4201/mf-manifest.json'
91
- * });
92
- * ```
93
- * to use init():
94
- * ```ts
95
- * import { init } from '@module-federation/enhanced/runtime';
96
- *
97
- * init({
98
- * name: 'host',
99
- * remotes: [{
100
- * name: 'my-remote-app',
101
- * entry: 'http://localhost:4201/mf-manifest.json'
102
- * }]
103
- * });
104
- * ```
105
- */
106
- function setRemoteDefinitions(definitions) {
107
- remoteUrlDefinitions = definitions;
108
- }
109
- /**
110
- * @deprecated Use registerRemotes() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
111
- * If you set a remote app with `setRemoteDefinition` such as:
112
- * ```ts
113
- * import { setRemoteDefinition } from '@nx/angular/mf';
114
- *
115
- * setRemoteDefinition(
116
- * 'my-remote-app',
117
- * 'http://localhost:4201/mf-manifest.json'
118
- * );
119
- * ```
120
- * change it to use registerRemotes():
121
- * ```ts
122
- * import { registerRemotes } from '@module-federation/enhanced/runtime';
123
- *
124
- * registerRemotes([
125
- * {
126
- * name: 'my-remote-app',
127
- * entry: 'http://localhost:4201/mf-manifest.json'
128
- * }
129
- * ]);
130
- * ```
131
- */
132
- function setRemoteDefinition(remoteName, remoteUrl) {
133
- remoteUrlDefinitions ??= {};
134
- remoteUrlDefinitions[remoteName] = remoteUrl;
135
- }
136
- let remoteModuleMap = new Map();
137
- let remoteContainerMap = new Map();
138
- /**
139
- * @deprecated Use loadRemote() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
140
- * If you set a load a remote with `loadRemoteModule` such as:
141
- * ```ts
142
- * import { loadRemoteModule } from '@nx/angular/mf';
143
- *
144
- * loadRemoteModule('my-remote-app', './Module').then(m => m.RemoteEntryModule);
145
- * ```
146
- * change it to use loadRemote():
147
- * ```ts
148
- * import { loadRemote } from '@module-federation/enhanced/runtime';
149
- *
150
- * loadRemote<typeof import('my-remote-app/Module')>('my-remote-app/Module').then(m => m.RemoteEntryModule);
151
- * ```
152
- */
153
- async function loadRemoteModule(remoteName, moduleName) {
154
- const remoteModuleKey = `${remoteName}:${moduleName}`;
155
- if (remoteModuleMap.has(remoteModuleKey)) {
156
- return remoteModuleMap.get(remoteModuleKey);
157
- }
158
- const container = remoteContainerMap.has(remoteName)
159
- ? remoteContainerMap.get(remoteName)
160
- : await loadRemoteContainer(remoteName);
161
- const factory = await container.get(moduleName);
162
- const Module = factory();
163
- remoteModuleMap.set(remoteModuleKey, Module);
164
- return Module;
165
- }
166
- function loadModule(url) {
167
- return import(/* webpackIgnore:true */ url);
168
- }
169
- let initialSharingScopeCreated = false;
170
- async function loadRemoteContainer(remoteName) {
171
- if (!resolveRemoteUrl && !remoteUrlDefinitions) {
172
- throw new Error('Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.');
173
- }
174
- if (!initialSharingScopeCreated) {
175
- initialSharingScopeCreated = true;
176
- await __webpack_init_sharing__('default');
177
- }
178
- const remoteUrl = remoteUrlDefinitions
179
- ? remoteUrlDefinitions[remoteName]
180
- : await resolveRemoteUrl(remoteName);
181
- const containerUrl = processRuntimeRemoteUrl(remoteUrl, 'mjs');
182
- const container = await loadModule(containerUrl);
183
- await container.init(__webpack_share_scopes__.default);
184
- remoteContainerMap.set(remoteName, container);
185
- return container;
186
- }
187
-
188
- /**
189
- * Generated bundle index. Do not edit.
190
- */
191
-
192
- export { loadRemoteModule, setRemoteDefinition, setRemoteDefinitions, setRemoteUrlResolver };
193
- //# sourceMappingURL=nx-angular-mf.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nx-angular-mf.mjs","sources":["../../mf/url-helpers.ts","../../mf/mf.ts","../../mf/nx-angular-mf.ts"],"sourcesContent":["// Helper function to extract file extension from a path\nfunction extname(path: string): string {\n const lastDot = path.lastIndexOf('.');\n const lastSlash = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\\\'));\n if (lastDot === -1 || lastDot < lastSlash) {\n return '';\n }\n return path.slice(lastDot);\n}\n\n/**\n * Checks if a URL string is absolute (has protocol)\n */\nexport function isAbsoluteUrl(url: string): boolean {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Safely processes remote locations, handling both relative and absolute URLs\n * while preserving query parameters and hash fragments for absolute URLs\n */\nexport function processRemoteLocation(\n remoteLocation: string,\n remoteEntryExt: 'js' | 'mjs'\n): string {\n // Handle promise-based remotes as-is\n if (remoteLocation.startsWith('promise new Promise')) {\n return remoteLocation;\n }\n\n if (isAbsoluteUrl(remoteLocation)) {\n // Use new URL parsing for absolute URLs (supports query params/hash)\n const url = new URL(remoteLocation);\n const ext = extname(url.pathname);\n const needsRemoteEntry = !['.js', '.mjs', '.json'].includes(ext);\n\n if (needsRemoteEntry) {\n url.pathname = url.pathname.endsWith('/')\n ? `${url.pathname}remoteEntry.${remoteEntryExt}`\n : `${url.pathname}/remoteEntry.${remoteEntryExt}`;\n }\n\n return url.href;\n } else {\n // Use string manipulation for relative URLs (backward compatibility)\n const ext = extname(remoteLocation);\n const needsRemoteEntry = !['.js', '.mjs', '.json'].includes(ext);\n\n if (needsRemoteEntry) {\n const baseRemote = remoteLocation.endsWith('/')\n ? remoteLocation.slice(0, -1)\n : remoteLocation;\n return `${baseRemote}/remoteEntry.${remoteEntryExt}`;\n }\n\n return remoteLocation;\n }\n}\n\n/**\n * Processes remote URLs for runtime environments, resolving relative URLs against window.location.origin\n */\nexport function processRuntimeRemoteUrl(\n remoteUrl: string,\n remoteEntryExt: 'js' | 'mjs'\n): string {\n if (isAbsoluteUrl(remoteUrl)) {\n return processRemoteLocation(remoteUrl, remoteEntryExt);\n } else {\n // For runtime relative URLs, resolve against current origin\n const baseUrl =\n typeof globalThis !== 'undefined' &&\n typeof (globalThis as any).window !== 'undefined' &&\n (globalThis as any).window.location\n ? (globalThis as any).window.location.origin\n : 'http://localhost';\n const absoluteUrl = new URL(remoteUrl, baseUrl).href;\n return processRemoteLocation(absoluteUrl, remoteEntryExt);\n }\n}\n","import { processRuntimeRemoteUrl } from './url-helpers';\n\nexport type ResolveRemoteUrlFunction = (\n remoteName: string\n) => string | Promise<string>;\n\ndeclare const __webpack_init_sharing__: (scope: 'default') => Promise<void>;\ndeclare const __webpack_share_scopes__: { default: unknown };\n\nlet resolveRemoteUrl: ResolveRemoteUrlFunction;\n\n/**\n * @deprecated Use Runtime Helpers from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.\n */\nexport function setRemoteUrlResolver(\n _resolveRemoteUrl: ResolveRemoteUrlFunction\n) {\n resolveRemoteUrl = _resolveRemoteUrl;\n}\n\nlet remoteUrlDefinitions: Record<string, string>;\n\n/**\n * @deprecated Use init() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.\n * If you have a remote app called `my-remote-app` and you want to use the `http://localhost:4201/mf-manifest.json` as the remote url, you should change it from:\n * ```ts\n * import { setRemoteDefinitions } from '@nx/angular/mf';\n *\n * setRemoteDefinitions({\n * 'my-remote-app': 'http://localhost:4201/mf-manifest.json'\n * });\n * ```\n * to use init():\n * ```ts\n * import { init } from '@module-federation/enhanced/runtime';\n *\n * init({\n * name: 'host',\n * remotes: [{\n * name: 'my-remote-app',\n * entry: 'http://localhost:4201/mf-manifest.json'\n * }]\n * });\n * ```\n */\nexport function setRemoteDefinitions(definitions: Record<string, string>) {\n remoteUrlDefinitions = definitions;\n}\n\n/**\n * @deprecated Use registerRemotes() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.\n * If you set a remote app with `setRemoteDefinition` such as:\n * ```ts\n * import { setRemoteDefinition } from '@nx/angular/mf';\n *\n * setRemoteDefinition(\n * 'my-remote-app',\n * 'http://localhost:4201/mf-manifest.json'\n * );\n * ```\n * change it to use registerRemotes():\n * ```ts\n * import { registerRemotes } from '@module-federation/enhanced/runtime';\n *\n * registerRemotes([\n * {\n * name: 'my-remote-app',\n * entry: 'http://localhost:4201/mf-manifest.json'\n * }\n * ]);\n * ```\n */\nexport function setRemoteDefinition(remoteName: string, remoteUrl: string) {\n remoteUrlDefinitions ??= {};\n remoteUrlDefinitions[remoteName] = remoteUrl;\n}\n\nlet remoteModuleMap = new Map<string, unknown>();\nlet remoteContainerMap = new Map<string, unknown>();\n\n/**\n * @deprecated Use loadRemote() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.\n * If you set a load a remote with `loadRemoteModule` such as:\n * ```ts\n * import { loadRemoteModule } from '@nx/angular/mf';\n *\n * loadRemoteModule('my-remote-app', './Module').then(m => m.RemoteEntryModule);\n * ```\n * change it to use loadRemote():\n * ```ts\n * import { loadRemote } from '@module-federation/enhanced/runtime';\n *\n * loadRemote<typeof import('my-remote-app/Module')>('my-remote-app/Module').then(m => m.RemoteEntryModule);\n * ```\n */\nexport async function loadRemoteModule(remoteName: string, moduleName: string) {\n const remoteModuleKey = `${remoteName}:${moduleName}`;\n if (remoteModuleMap.has(remoteModuleKey)) {\n return remoteModuleMap.get(remoteModuleKey);\n }\n\n const container = remoteContainerMap.has(remoteName)\n ? remoteContainerMap.get(remoteName)\n : await loadRemoteContainer(remoteName);\n\n const factory = await container.get(moduleName);\n const Module = factory();\n\n remoteModuleMap.set(remoteModuleKey, Module);\n\n return Module;\n}\n\nfunction loadModule(url: string) {\n return import(/* webpackIgnore:true */ url);\n}\n\nlet initialSharingScopeCreated = false;\n\nasync function loadRemoteContainer(remoteName: string) {\n if (!resolveRemoteUrl && !remoteUrlDefinitions) {\n throw new Error(\n 'Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.'\n );\n }\n\n if (!initialSharingScopeCreated) {\n initialSharingScopeCreated = true;\n await __webpack_init_sharing__('default');\n }\n\n const remoteUrl = remoteUrlDefinitions\n ? remoteUrlDefinitions[remoteName]\n : await resolveRemoteUrl(remoteName);\n\n const containerUrl = processRuntimeRemoteUrl(remoteUrl, 'mjs');\n\n const container = await loadModule(containerUrl);\n await container.init(__webpack_share_scopes__.default);\n\n remoteContainerMap.set(remoteName, container);\n return container;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- {
2
- "module": "../fesm2022/nx-angular-mf.mjs",
3
- "typings": "../types/nx-angular-mf.d.ts"
4
- }
@@ -1,11 +0,0 @@
1
- import { ProjectConfiguration } from '@nx/devkit';
2
- export type DevRemoteDefinition = string | {
3
- remoteName: string;
4
- configuration: string;
5
- };
6
- export declare function getDynamicRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>, pathToManifestFile: string | undefined): string[];
7
- export declare function getStaticRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>): string[];
8
- export declare function validateDevRemotes(options: {
9
- devRemotes: DevRemoteDefinition[];
10
- }, workspaceProjects: Record<string, ProjectConfiguration>): void;
11
- export declare function getDynamicMfManifestFile(project: ProjectConfiguration, workspaceRoot: string): string | undefined;
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDynamicRemotes = getDynamicRemotes;
4
- exports.getStaticRemotes = getStaticRemotes;
5
- exports.validateDevRemotes = validateDevRemotes;
6
- exports.getDynamicMfManifestFile = getDynamicMfManifestFile;
7
- const devkit_1 = require("@nx/devkit");
8
- const internal_1 = require("@nx/js/internal");
9
- const fs_1 = require("fs");
10
- const path_1 = require("path");
11
- function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, pathToManifestFile) {
12
- pathToManifestFile ??= getDynamicMfManifestFile(project, context.workspaceRoot);
13
- // check for dynamic remotes
14
- // we should only check for dynamic based on what we generate
15
- // and fallback to empty array
16
- if (!pathToManifestFile || !(0, fs_1.existsSync)(pathToManifestFile)) {
17
- return [];
18
- }
19
- const moduleFederationManifestJson = (0, fs_1.readFileSync)(pathToManifestFile, 'utf-8');
20
- if (!moduleFederationManifestJson) {
21
- return [];
22
- }
23
- // This should have shape of
24
- // {
25
- // "remoteName": "remoteLocation",
26
- // }
27
- const parsedManifest = JSON.parse(moduleFederationManifestJson);
28
- if (!Object.keys(parsedManifest).every((key) => typeof key === 'string' && typeof parsedManifest[key] === 'string')) {
29
- return [];
30
- }
31
- const allDynamicRemotes = Object.entries(parsedManifest)
32
- .map(([remoteName]) => remoteName)
33
- .filter((r) => !remotesToSkip.has(r));
34
- const remotesNotInWorkspace = [];
35
- const dynamicRemotes = allDynamicRemotes.filter((remote) => {
36
- if (!workspaceProjects[remote]) {
37
- remotesNotInWorkspace.push(remote);
38
- return false;
39
- }
40
- return true;
41
- });
42
- if (remotesNotInWorkspace.length > 0) {
43
- devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
44
- }
45
- return dynamicRemotes;
46
- }
47
- function getModuleFederationConfig(tsconfigPath, workspaceRoot, projectRoot) {
48
- const moduleFederationConfigPathJS = (0, path_1.join)(workspaceRoot, projectRoot, 'module-federation.config.js');
49
- const moduleFederationConfigPathTS = (0, path_1.join)(workspaceRoot, projectRoot, 'module-federation.config.ts');
50
- const isTsConfig = (0, fs_1.existsSync)(moduleFederationConfigPathTS);
51
- const moduleFederationConfigPath = isTsConfig
52
- ? moduleFederationConfigPathTS
53
- : moduleFederationConfigPathJS;
54
- try {
55
- const config = isTsConfig
56
- ? (0, internal_1.loadTsFile)(moduleFederationConfigPath, (0, path_1.join)(workspaceRoot, tsconfigPath))
57
- : require(moduleFederationConfigPath);
58
- return {
59
- mfeConfig: config.default || config,
60
- mfConfigPath: moduleFederationConfigPath,
61
- };
62
- }
63
- catch {
64
- throw new Error(`Could not load ${moduleFederationConfigPath}. Was this project generated with "@nx/angular:host"?`);
65
- }
66
- }
67
- function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
68
- const { mfeConfig, mfConfigPath } = getModuleFederationConfig(project.targets.build.options.tsConfig, context.workspaceRoot, project.root);
69
- const remotesConfig = Array.isArray(mfeConfig.remotes) && mfeConfig.remotes.length > 0
70
- ? mfeConfig.remotes
71
- : [];
72
- const allStaticRemotes = remotesConfig
73
- .map((remoteDefinition) => Array.isArray(remoteDefinition) ? remoteDefinition[0] : remoteDefinition)
74
- .filter((r) => !remotesToSkip.has(r));
75
- const remotesNotInWorkspace = [];
76
- const staticRemotes = allStaticRemotes.filter((remote) => {
77
- if (!workspaceProjects[remote]) {
78
- remotesNotInWorkspace.push(remote);
79
- return false;
80
- }
81
- return true;
82
- });
83
- if (remotesNotInWorkspace.length > 0) {
84
- devkit_1.logger.warn(`Skipping serving ${remotesNotInWorkspace.join(', ')} as they could not be found in the workspace. Ensure they are served correctly.`);
85
- }
86
- return staticRemotes;
87
- }
88
- function validateDevRemotes(options, workspaceProjects) {
89
- const invalidDevRemotes = options.devRemotes.filter((remote) => !(typeof remote === 'string'
90
- ? workspaceProjects[remote]
91
- : workspaceProjects[remote.remoteName])) ?? [];
92
- if (invalidDevRemotes.length) {
93
- throw new Error(invalidDevRemotes.length === 1
94
- ? `Invalid dev remote provided: ${invalidDevRemotes[0]}.`
95
- : `Invalid dev remotes provided: ${invalidDevRemotes.join(', ')}.`);
96
- }
97
- }
98
- function getDynamicMfManifestFile(project, workspaceRoot) {
99
- // {sourceRoot}/assets/module-federation.manifest.json was the generated
100
- // path for the manifest file in the past. We now generate the manifest
101
- // file at {root}/public/module-federation.manifest.json. This check
102
- // ensures that we can still support the old path for backwards
103
- // compatibility since old projects may still have the manifest file
104
- // at the old path.
105
- return [
106
- (0, path_1.join)(workspaceRoot, project.root, 'public/module-federation.manifest.json'),
107
- (0, path_1.join)(workspaceRoot, (0, internal_1.getProjectSourceRoot)(project), 'assets/module-federation.manifest.json'),
108
- ].find((path) => (0, fs_1.existsSync)(path));
109
- }
@@ -1,2 +0,0 @@
1
- export * from './normalize-options';
2
- export * from './start-dev-remotes';
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./normalize-options"), exports);
5
- tslib_1.__exportStar(require("./start-dev-remotes"), exports);
@@ -1,2 +0,0 @@
1
- import type { NormalizedSchema, Schema } from '../schema';
2
- export declare function normalizeOptions(schema: Schema): NormalizedSchema;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeOptions = normalizeOptions;
4
- const path_1 = require("path");
5
- const devkit_1 = require("@nx/devkit");
6
- function normalizeOptions(schema) {
7
- schema.buildLibsFromSource ??= true;
8
- process.env.NX_BUILD_LIBS_FROM_SOURCE = `${schema.buildLibsFromSource}`;
9
- process.env.NX_BUILD_TARGET = `${schema.buildTarget}`;
10
- return {
11
- ...schema,
12
- devRemotes: schema.devRemotes ?? [],
13
- host: schema.host ?? 'localhost',
14
- port: schema.port ?? 4200,
15
- liveReload: schema.liveReload ?? true,
16
- open: schema.open ?? false,
17
- ssl: schema.ssl ?? false,
18
- verbose: schema.verbose ?? false,
19
- sslCert: schema.sslCert ? (0, path_1.join)(devkit_1.workspaceRoot, schema.sslCert) : undefined,
20
- sslKey: schema.sslKey ? (0, path_1.join)(devkit_1.workspaceRoot, schema.sslKey) : undefined,
21
- };
22
- }
@@ -1,5 +0,0 @@
1
- import { type Schema } from '../schema';
2
- import { type ExecutorContext, type ProjectConfiguration } from '@nx/devkit';
3
- export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Pick<Schema, 'devRemotes' | 'verbose'>, context: ExecutorContext, target?: 'serve' | 'serve-static'): Promise<AsyncIterable<{
4
- success: boolean;
5
- }>[]>;