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

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 (204) hide show
  1. package/dist/executors.d.ts +0 -2
  2. package/dist/executors.js +0 -2
  3. package/dist/fesm2022/nx-angular.mjs +0 -4
  4. package/dist/generators.d.ts +0 -4
  5. package/dist/generators.js +0 -4
  6. package/dist/src/executors/application/schema.json +1 -2
  7. package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +9 -1
  8. package/dist/src/executors/unit-test/schema.json +6 -1
  9. package/dist/src/executors/unit-test/unit-test.impl.js +5 -0
  10. package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.js +35 -10
  11. package/dist/src/generators/add-linting/add-linting.js +0 -2
  12. package/dist/src/generators/add-linting/schema.d.ts +0 -1
  13. package/dist/src/generators/application/application.js +1 -2
  14. package/dist/src/generators/application/lib/add-e2e.js +0 -6
  15. package/dist/src/generators/application/lib/add-linting.js +0 -1
  16. package/dist/src/generators/application/lib/add-unit-test-runner.js +0 -2
  17. package/dist/src/generators/application/lib/normalize-options.d.ts +1 -1
  18. package/dist/src/generators/application/lib/normalize-options.js +1 -8
  19. package/dist/src/generators/application/schema.d.ts +0 -1
  20. package/dist/src/generators/application/schema.json +1 -1
  21. package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +3 -4
  22. package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +1 -2
  23. package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +0 -63
  24. package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.d.ts +2 -0
  25. package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.js +32 -0
  26. package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -15
  27. package/dist/src/generators/init/init.js +1 -2
  28. package/dist/src/generators/init/schema.d.ts +0 -2
  29. package/dist/src/generators/library/schema.d.ts +0 -1
  30. package/dist/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +12 -1
  31. package/dist/src/generators/ng-add/migrators/projects/e2e.migrator.js +12 -16
  32. package/dist/src/generators/ng-add/utilities/workspace.js +1 -3
  33. package/dist/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
  34. package/dist/src/generators/utils/add-jest.d.ts +0 -1
  35. package/dist/src/generators/utils/add-jest.js +0 -2
  36. package/dist/src/generators/utils/add-vitest.d.ts +0 -1
  37. package/dist/src/generators/utils/add-vitest.js +0 -1
  38. package/dist/src/generators/utils/testing.d.ts +0 -4
  39. package/dist/src/generators/utils/testing.js +0 -12
  40. package/dist/src/migrations/update-23-1-0/add-angular-build.js +7 -3
  41. package/dist/src/migrations/update-23-1-0/add-angular-build.md +1 -1
  42. package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.js +9 -2
  43. package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.d.ts +5 -0
  44. package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.js +332 -0
  45. package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.md +46 -0
  46. package/dist/src/utils/assert-cypress-component-testing-support.js +10 -0
  47. package/dist/src/utils/backward-compatible-versions.js +0 -8
  48. package/dist/src/utils/versions.d.ts +4 -8
  49. package/dist/src/utils/versions.js +5 -9
  50. package/dist/types/nx-angular.d.ts +1 -3
  51. package/executors.json +0 -10
  52. package/generators.json +0 -35
  53. package/migrations.json +97 -0
  54. package/package.json +11 -20
  55. package/dist/.npmignore +0 -2
  56. package/dist/fesm2022/nx-angular-mf.mjs +0 -193
  57. package/dist/fesm2022/nx-angular-mf.mjs.map +0 -1
  58. package/dist/fesm2022/nx-angular.mjs.map +0 -1
  59. package/dist/mf/package.json +0 -4
  60. package/dist/src/builders/utilities/module-federation.d.ts +0 -11
  61. package/dist/src/builders/utilities/module-federation.js +0 -109
  62. package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
  63. package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
  64. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
  65. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -22
  66. package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -5
  67. package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
  68. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
  69. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -111
  70. package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -38
  71. package/dist/src/executors/module-federation-dev-server/schema.json +0 -171
  72. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -2
  73. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -20
  74. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.d.ts +0 -5
  75. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.js +0 -30
  76. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -4
  77. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -110
  78. package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -17
  79. package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -124
  80. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +0 -4
  81. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.js +0 -36
  82. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +0 -5
  83. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +0 -448
  84. package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +0 -2
  85. package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.js +0 -22
  86. package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +0 -2
  87. package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +0 -45
  88. package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +0 -2
  89. package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +0 -18
  90. package/dist/src/generators/convert-to-with-mf/lib/index.d.ts +0 -6
  91. package/dist/src/generators/convert-to-with-mf/lib/index.js +0 -9
  92. package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +0 -5
  93. package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +0 -57
  94. package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +0 -2
  95. package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +0 -13
  96. package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +0 -3
  97. package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +0 -50
  98. package/dist/src/generators/convert-to-with-mf/schema.d.ts +0 -4
  99. package/dist/src/generators/convert-to-with-mf/schema.json +0 -33
  100. package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
  101. package/dist/src/generators/federate-module/federate-module.js +0 -49
  102. package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +0 -2
  103. package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +0 -14
  104. package/dist/src/generators/federate-module/lib/add-path-to-exposes.d.ts +0 -8
  105. package/dist/src/generators/federate-module/lib/add-path-to-exposes.js +0 -77
  106. package/dist/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +0 -8
  107. package/dist/src/generators/federate-module/lib/add-path-to-ts-config.js +0 -11
  108. package/dist/src/generators/federate-module/lib/add-remote.d.ts +0 -7
  109. package/dist/src/generators/federate-module/lib/add-remote.js +0 -42
  110. package/dist/src/generators/federate-module/lib/check-remote-exists.d.ts +0 -2
  111. package/dist/src/generators/federate-module/lib/check-remote-exists.js +0 -21
  112. package/dist/src/generators/federate-module/lib/index.d.ts +0 -4
  113. package/dist/src/generators/federate-module/lib/index.js +0 -7
  114. package/dist/src/generators/federate-module/schema.d.ts +0 -13
  115. package/dist/src/generators/federate-module/schema.json +0 -83
  116. package/dist/src/generators/host/files/common/src/main.server.ts__tmpl__ +0 -78
  117. package/dist/src/generators/host/files/js/webpack.server.config.js__tmpl__ +0 -8
  118. package/dist/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +0 -9
  119. package/dist/src/generators/host/host.d.ts +0 -4
  120. package/dist/src/generators/host/host.js +0 -133
  121. package/dist/src/generators/host/lib/index.d.ts +0 -2
  122. package/dist/src/generators/host/lib/index.js +0 -5
  123. package/dist/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
  124. package/dist/src/generators/host/lib/update-ssr-setup.js +0 -54
  125. package/dist/src/generators/host/lib/validate-options.d.ts +0 -3
  126. package/dist/src/generators/host/lib/validate-options.js +0 -12
  127. package/dist/src/generators/host/schema.d.ts +0 -36
  128. package/dist/src/generators/host/schema.json +0 -195
  129. package/dist/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +0 -9
  130. package/dist/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +0 -9
  131. package/dist/src/generators/remote/files/common/src/main.server.ts__tmpl__ +0 -84
  132. package/dist/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +0 -12
  133. package/dist/src/generators/remote/lib/find-next-available-port.d.ts +0 -2
  134. package/dist/src/generators/remote/lib/find-next-available-port.js +0 -16
  135. package/dist/src/generators/remote/lib/index.d.ts +0 -3
  136. package/dist/src/generators/remote/lib/index.js +0 -6
  137. package/dist/src/generators/remote/lib/update-ssr-setup.d.ts +0 -9
  138. package/dist/src/generators/remote/lib/update-ssr-setup.js +0 -82
  139. package/dist/src/generators/remote/lib/validate-options.d.ts +0 -3
  140. package/dist/src/generators/remote/lib/validate-options.js +0 -12
  141. package/dist/src/generators/remote/remote.d.ts +0 -4
  142. package/dist/src/generators/remote/remote.js +0 -114
  143. package/dist/src/generators/remote/schema.d.ts +0 -34
  144. package/dist/src/generators/remote/schema.json +0 -184
  145. package/dist/src/generators/setup-mf/files/entry-module-files/__entryModuleFileName__.ts__tmpl__ +0 -18
  146. package/dist/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +0 -4
  147. package/dist/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +0 -10
  148. package/dist/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -42
  149. package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +0 -4
  150. package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +0 -11
  151. package/dist/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -27
  152. package/dist/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
  153. package/dist/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +0 -9
  154. package/dist/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +0 -21
  155. package/dist/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +0 -23
  156. package/dist/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +0 -9
  157. package/dist/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +0 -21
  158. package/dist/src/generators/setup-mf/lib/add-cypress-workaround.d.ts +0 -3
  159. package/dist/src/generators/setup-mf/lib/add-cypress-workaround.js +0 -52
  160. package/dist/src/generators/setup-mf/lib/add-remote-entry.d.ts +0 -3
  161. package/dist/src/generators/setup-mf/lib/add-remote-entry.js +0 -27
  162. package/dist/src/generators/setup-mf/lib/add-remote-to-host.d.ts +0 -9
  163. package/dist/src/generators/setup-mf/lib/add-remote-to-host.js +0 -127
  164. package/dist/src/generators/setup-mf/lib/change-build-target.d.ts +0 -3
  165. package/dist/src/generators/setup-mf/lib/change-build-target.js +0 -24
  166. package/dist/src/generators/setup-mf/lib/fix-bootstrap.d.ts +0 -3
  167. package/dist/src/generators/setup-mf/lib/fix-bootstrap.js +0 -40
  168. package/dist/src/generators/setup-mf/lib/generate-config.d.ts +0 -6
  169. package/dist/src/generators/setup-mf/lib/generate-config.js +0 -32
  170. package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.d.ts +0 -6
  171. package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.js +0 -20
  172. package/dist/src/generators/setup-mf/lib/index.d.ts +0 -15
  173. package/dist/src/generators/setup-mf/lib/index.js +0 -18
  174. package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.d.ts +0 -2
  175. package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.js +0 -15
  176. package/dist/src/generators/setup-mf/lib/normalize-options.d.ts +0 -3
  177. package/dist/src/generators/setup-mf/lib/normalize-options.js +0 -26
  178. package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +0 -3
  179. package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +0 -61
  180. package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.d.ts +0 -3
  181. package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.js +0 -20
  182. package/dist/src/generators/setup-mf/lib/setup-serve-target.d.ts +0 -3
  183. package/dist/src/generators/setup-mf/lib/setup-serve-target.js +0 -39
  184. package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +0 -3
  185. package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.js +0 -15
  186. package/dist/src/generators/setup-mf/lib/update-host-app-routes.d.ts +0 -3
  187. package/dist/src/generators/setup-mf/lib/update-host-app-routes.js +0 -39
  188. package/dist/src/generators/setup-mf/lib/update-tsconfig.d.ts +0 -3
  189. package/dist/src/generators/setup-mf/lib/update-tsconfig.js +0 -18
  190. package/dist/src/generators/setup-mf/schema.d.ts +0 -35
  191. package/dist/src/generators/setup-mf/schema.json +0 -99
  192. package/dist/src/generators/setup-mf/setup-mf.d.ts +0 -4
  193. package/dist/src/generators/setup-mf/setup-mf.js +0 -90
  194. package/dist/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
  195. package/dist/src/generators/utils/add-mf-env-to-inputs.js +0 -36
  196. package/dist/src/generators/utils/assert-mf-utils.d.ts +0 -1
  197. package/dist/src/generators/utils/assert-mf-utils.js +0 -8
  198. package/dist/src/utils/get-mf-projects.d.ts +0 -4
  199. package/dist/src/utils/get-mf-projects.js +0 -31
  200. package/dist/src/utils/module-federation-deprecation.d.ts +0 -4
  201. package/dist/src/utils/module-federation-deprecation.js +0 -29
  202. package/dist/types/nx-angular-mf.d.ts +0 -72
  203. package/dist/types/nx-angular-mf.d.ts.map +0 -1
  204. package/dist/types/nx-angular.d.ts.map +0 -1
@@ -1,110 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.moduleFederationSsrDevServerExecutor = moduleFederationSsrDevServerExecutor;
4
- const devkit_1 = require("@nx/devkit");
5
- const internal_1 = require("@nx/devkit/internal");
6
- const internal_2 = require("@nx/web/internal");
7
- const fs_1 = require("fs");
8
- const path_1 = require("path");
9
- const module_federation_1 = require("../../builders/utilities/module-federation");
10
- const builder_package_1 = require("../utilities/builder-package");
11
- const normalize_options_1 = require("./lib/normalize-options");
12
- const start_dev_remotes_1 = require("./lib/start-dev-remotes");
13
- const module_federation_deprecation_1 = require("../../utils/module-federation-deprecation");
14
- const ngcli_adapter_1 = require("@nx/devkit/ngcli-adapter");
15
- // This is required to ensure that the webpack version used by the Module Federation is the same as the one used by the builders.
16
- const Module = require('module');
17
- const originalResolveFilename = Module._resolveFilename;
18
- const patchedWebpackPath = require.resolve('webpack', {
19
- paths: [require.resolve('@angular-devkit/build-angular')],
20
- });
21
- // Override the resolve function
22
- Module._resolveFilename = function (request, parent, isMain, options) {
23
- // Intercept webpack specifically
24
- if (request === 'webpack') {
25
- // Force webpack to resolve from your specific path
26
- return patchedWebpackPath;
27
- }
28
- // For all other modules, use the original resolver
29
- return originalResolveFilename.call(this, request, parent, isMain, options);
30
- };
31
- async function* moduleFederationSsrDevServerExecutor(schema, context) {
32
- (0, builder_package_1.assertPackageIsInstalled)('@nx/module-federation', '@nx/angular:module-federation-dev-ssr');
33
- const { startRemoteIterators } = await import('@nx/module-federation/internal');
34
- (0, module_federation_deprecation_1.warnAngularMfDevSsrExecutorDeprecation)();
35
- const options = (0, normalize_options_1.normalizeOptions)(schema);
36
- (0, builder_package_1.assertPackageIsInstalled)('@angular-devkit/build-angular', '@nx/angular:module-federation-dev-ssr');
37
- const { executeSSRDevServerBuilder } = await import('@angular-devkit/build-angular');
38
- const currIter = (0, internal_1.eachValueFrom)(executeSSRDevServerBuilder(options, await (0, ngcli_adapter_1.createBuilderContext)({
39
- builderName: '@nx/angular:webpack-server',
40
- description: 'Build a ssr application',
41
- optionSchema: require('../../builders/webpack-server/schema.json'),
42
- }, context)));
43
- if (options.isInitialHost === false) {
44
- return yield* currIter;
45
- }
46
- const { projects: workspaceProjects } = (0, devkit_1.readProjectsConfigurationFromProjectGraph)(context.projectGraph);
47
- const project = workspaceProjects[context.projectName];
48
- let pathToManifestFile;
49
- if (options.pathToManifestFile) {
50
- const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
51
- if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
52
- throw new Error(`The provided Module Federation manifest file path does not exist. Please check the file exists at "${userPathToManifestFile}".`);
53
- }
54
- else if ((0, path_1.extname)(options.pathToManifestFile) !== '.json') {
55
- throw new Error(`The Module Federation manifest file must be a JSON. Please ensure the file at ${userPathToManifestFile} is a JSON.`);
56
- }
57
- pathToManifestFile = userPathToManifestFile;
58
- }
59
- else {
60
- pathToManifestFile = (0, module_federation_1.getDynamicMfManifestFile)(project, context.root);
61
- }
62
- (0, module_federation_1.validateDevRemotes)({ devRemotes: options.devRemotes }, workspaceProjects);
63
- const { remotes, staticRemotesIter, devRemoteIters } = await startRemoteIterators(options, context, start_dev_remotes_1.startRemotes, pathToManifestFile, 'angular', true);
64
- const removeBaseUrlEmission = (iter) => (0, internal_1.mapAsyncIterable)(iter, (v) => ({
65
- ...v,
66
- baseUrl: undefined,
67
- }));
68
- const combined = (0, internal_1.combineAsyncIterables)(removeBaseUrlEmission(staticRemotesIter), ...(devRemoteIters ? devRemoteIters.map(removeBaseUrlEmission) : []), (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
69
- if (!options.isInitialHost) {
70
- done();
71
- return;
72
- }
73
- if (remotes.remotePorts.length) {
74
- devkit_1.logger.info(`Nx All remotes started, server ready at http://localhost:${options.port}`);
75
- next({ success: true, baseUrl: `http://localhost:${options.port}` });
76
- done();
77
- return;
78
- }
79
- try {
80
- const portsToWaitFor = staticRemotesIter && options.staticRemotesPort
81
- ? [options.staticRemotesPort, ...remotes.remotePorts]
82
- : [...remotes.remotePorts];
83
- await Promise.all(portsToWaitFor.map((port) => (0, internal_2.waitForPortOpen)(port, {
84
- retries: 480,
85
- retryDelay: 2500,
86
- host: 'localhost',
87
- })));
88
- next({ success: true, baseUrl: `http://localhost:${options.port}` });
89
- }
90
- catch (error) {
91
- throw new Error(`Failed to start remotes. Check above for any errors.`, {
92
- cause: error,
93
- });
94
- }
95
- finally {
96
- done();
97
- }
98
- }));
99
- let refs = 2 + (devRemoteIters?.length ?? 0);
100
- for await (const result of combined) {
101
- if (result.success === false)
102
- throw new Error('Remotes failed to start');
103
- if (result.success)
104
- refs--;
105
- if (refs === 0)
106
- break;
107
- }
108
- return yield* currIter;
109
- }
110
- exports.default = moduleFederationSsrDevServerExecutor;
@@ -1,17 +0,0 @@
1
- import { type DevRemoteDefinition } from '../../builders/utilities/module-federation';
2
- import type { SSRDevServerBuilderOptions } from '@angular-devkit/build-angular';
3
-
4
- export interface Schema extends SSRDevServerBuilderOptions {
5
- devRemotes?: DevRemoteDefinition[];
6
- skipRemotes?: string[];
7
- pathToManifestFile?: string;
8
- parallel?: number;
9
- staticRemotesPort?: number;
10
- isInitialHost?: boolean;
11
- }
12
-
13
- export interface NormalizedSchema extends Schema {
14
- devRemotes: DevRemoteDefinition[];
15
- ssl: boolean;
16
- verbose: boolean;
17
- }
@@ -1,124 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "title": "Module Federation SSR Dev Server Target",
4
- "x-deprecated": "The `@nx/angular:module-federation-ssr-dev-server` executor is deprecated. Angular Module Federation in Nx is no longer supported; use `@angular-architects/native-federation`. Removed in Nx v24.",
5
- "continuous": true,
6
- "outputCapture": "direct-nodejs",
7
- "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.",
8
- "type": "object",
9
- "properties": {
10
- "browserTarget": {
11
- "type": "string",
12
- "description": "Browser target to build.",
13
- "pattern": ".+:.+(:.+)?"
14
- },
15
- "serverTarget": {
16
- "type": "string",
17
- "description": "Server target to build.",
18
- "pattern": ".+:.+(:.+)?"
19
- },
20
- "host": {
21
- "type": "string",
22
- "description": "Host to listen on.",
23
- "default": "localhost"
24
- },
25
- "port": {
26
- "type": "number",
27
- "default": 4200,
28
- "description": "Port to start the development server at. Default is 4200. Pass 0 to get a dynamically assigned port."
29
- },
30
- "publicHost": {
31
- "type": "string",
32
- "description": "The URL that the browser client should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
33
- },
34
- "open": {
35
- "type": "boolean",
36
- "description": "Opens the url in default browser.",
37
- "default": false,
38
- "alias": "o"
39
- },
40
- "progress": {
41
- "type": "boolean",
42
- "description": "Log progress to the console while building."
43
- },
44
- "inspect": {
45
- "type": "boolean",
46
- "description": "Launch the development server in inspector mode and listen on address and port '127.0.0.1:9229'.",
47
- "default": false
48
- },
49
- "ssl": {
50
- "type": "boolean",
51
- "description": "Serve using HTTPS.",
52
- "default": false
53
- },
54
- "sslKey": {
55
- "type": "string",
56
- "description": "SSL key to use for serving HTTPS."
57
- },
58
- "sslCert": {
59
- "type": "string",
60
- "description": "SSL certificate to use for serving HTTPS."
61
- },
62
- "proxyConfig": {
63
- "type": "string",
64
- "description": "Proxy configuration file."
65
- },
66
- "devRemotes": {
67
- "type": "array",
68
- "items": {
69
- "oneOf": [
70
- {
71
- "type": "string"
72
- },
73
- {
74
- "type": "object",
75
- "properties": {
76
- "remoteName": {
77
- "type": "string"
78
- },
79
- "configuration": {
80
- "type": "string"
81
- }
82
- },
83
- "required": ["remoteName"],
84
- "additionalProperties": false
85
- }
86
- ]
87
- },
88
- "description": "List of remote applications to run in development mode (i.e. using serve target).",
89
- "x-priority": "important"
90
- },
91
- "skipRemotes": {
92
- "type": "array",
93
- "items": {
94
- "type": "string"
95
- },
96
- "description": "List of remote applications to not automatically serve, either statically or in development mode."
97
- },
98
- "verbose": {
99
- "type": "boolean",
100
- "description": "Adds more details to output logging.",
101
- "default": false
102
- },
103
- "pathToManifestFile": {
104
- "type": "string",
105
- "description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
106
- },
107
- "isInitialHost": {
108
- "type": "boolean",
109
- "description": "Whether the host that is running this executor is the first in the project tree to do so.",
110
- "default": true,
111
- "x-priority": "internal"
112
- },
113
- "parallel": {
114
- "type": "number",
115
- "description": "Max number of parallel processes for building static remotes"
116
- },
117
- "staticRemotesPort": {
118
- "type": "number",
119
- "description": "The port at which to serve the file-server for the static remotes."
120
- }
121
- },
122
- "additionalProperties": false,
123
- "required": ["browserTarget", "serverTarget"]
124
- }
@@ -1,4 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- import type { Schema } from './schema';
3
- export declare function convertToWithMF(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
- export default convertToWithMF;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertToWithMF = convertToWithMF;
4
- const devkit_1 = require("@nx/devkit");
5
- const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
6
- const get_mf_projects_1 = require("../../utils/get-mf-projects");
7
- const versions_1 = require("../../utils/versions");
8
- const lib_1 = require("./lib");
9
- async function convertToWithMF(tree, schema) {
10
- (0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
11
- const projects = new Set((0, get_mf_projects_1.getMFProjects)(tree, { legacy: true }));
12
- if (!projects.has(schema.project)) {
13
- 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.`);
14
- }
15
- const project = (0, devkit_1.readProjectConfiguration)(tree, schema.project);
16
- const pathToWebpackConfig = (0, lib_1.getWebpackConfigPath)(project, schema.project);
17
- const webpackAst = (0, lib_1.parseASTOfWebpackConfig)(tree, pathToWebpackConfig);
18
- if (!(0, lib_1.checkOutputNameMatchesProjectName)(webpackAst, schema.project)) {
19
- throw new Error(`Cannot automatically migrate "${schema.project}" to "withModuleFederation" micro frontend webpack config.
20
- "uniqueName" in webpack config (${pathToWebpackConfig}) does not match project name.`);
21
- }
22
- if (!(0, lib_1.checkSharedNpmPackagesMatchExpected)(webpackAst)) {
23
- throw new Error(`Cannot automatically migrate "${schema.project}" to "withModuleFederation" micro frontend webpack config.
24
- There are npm packages being shared with a custom configuration in webpack config (${pathToWebpackConfig}).`);
25
- }
26
- 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.`);
27
- const [updatedWebpackConfig, mfConfig] = (0, lib_1.writeNewWebpackConfig)(webpackAst, (0, lib_1.isHostRemoteConfig)(webpackAst), schema.project);
28
- tree.write(pathToWebpackConfig, updatedWebpackConfig);
29
- tree.write((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js'), mfConfig);
30
- const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/module-federation': versions_1.nxVersion });
31
- if (!schema.skipFormat) {
32
- await (0, devkit_1.formatFiles)(tree);
33
- }
34
- return installTask;
35
- }
36
- exports.default = convertToWithMF;
@@ -1,5 +0,0 @@
1
- export declare const STANDARD_HOST_MFE_CONFIG = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'host1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n remotes: {\n remote1: 'http://localhost:4201/remoteEntry.mjs',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
2
- export declare const STANDARD_REMOTE_MFE_CONFIG = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'remote1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n name: 'remote1',\n filename: 'remoteEntry.js',\n exposes: {\n './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
3
- export declare const OLD_OBJECT_SHARED_SYNTAX = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'remote1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n name: 'remote1',\n filename: 'remoteEntry.js',\n exposes: {\n './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',\n },\n shared: {\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n },\n ...sharedMappings.getDescriptors(),\n },\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};";
4
- export declare const ERROR_NAME_DOESNT_MATCH = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'somethingelse',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n name: 'remote1',\n filename: 'remoteEntry.js',\n exposes: {\n './Module': 'apps/remote1/src/app/remote-entry/entry.module.ts',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";
5
- export declare const ERROR_SHARED_PACKAGES_DOESNT_MATCH = "const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');\nconst mf = require('@angular-architects/module-federation/webpack');\nconst path = require('path');\nconst share = mf.share;\n\n/**\n * We use the NX_TSCONFIG_PATH environment variable when using the @nx/angular:webpack-browser\n * builder as it will generate a temporary tsconfig file which contains any required remappings of\n * shared libraries.\n * A remapping will occur when a library is buildable, as webpack needs to know the location of the\n * built files for the buildable library.\n * This NX_TSCONFIG_PATH environment variable is set by the @nx/angular:webpack-browser and it contains\n * the location of the generated temporary tsconfig file.\n */\nconst tsConfigPath =\n process.env.NX_TSCONFIG_PATH ??\n path.join(__dirname, '../../tsconfig.base.json');\n\nconst workspaceRootPath = path.join(__dirname, '../../');\nconst sharedMappings = new mf.SharedMappings();\nsharedMappings.register(\n tsConfigPath,\n [\n /* mapped paths to share */\n ],\n workspaceRootPath\n);\n\nmodule.exports = {\n output: {\n uniqueName: 'host1',\n publicPath: 'auto',\n },\n optimization: {\n runtimeChunk: false,\n },\n experiments: {\n outputModule: true,\n },\n resolve: {\n alias: {\n ...sharedMappings.getAliases(),\n },\n },\n plugins: [\n new ModuleFederationPlugin({\n remotes: {\n remote1: 'http://localhost:4201/remoteEntry.mjs',\n },\n shared: share({\n '@angular/core': {\n singleton: true,\n strictVersion: true,\n requiredVersion: '13.0.0',\n includeSecondaries: true,\n },\n '@angular/common': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/common/http': {\n singleton: true,\n strictVersion: false,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n '@angular/router': {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n rxjs: {\n singleton: true,\n strictVersion: true,\n requiredVersion: 'auto',\n includeSecondaries: true,\n },\n ...sharedMappings.getDescriptors(),\n }),\n library: {\n type: 'module',\n },\n }),\n sharedMappings.getPlugin(),\n ],\n};\n";