@nx/angular 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/executors.d.ts +0 -2
- package/dist/executors.js +0 -2
- package/dist/fesm2022/nx-angular.mjs +0 -4
- package/dist/generators.d.ts +0 -8
- package/dist/generators.js +0 -8
- package/dist/ready-check.d.ts +1 -0
- package/dist/ready-check.js +8 -0
- package/dist/src/executors/application/schema.json +1 -2
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +9 -1
- package/dist/src/executors/unit-test/schema.json +6 -1
- package/dist/src/executors/unit-test/unit-test.impl.js +5 -0
- package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.js +35 -10
- package/dist/src/generators/add-linting/add-linting.js +1 -3
- package/dist/src/generators/add-linting/schema.d.ts +0 -5
- package/dist/src/generators/add-linting/schema.json +0 -6
- package/dist/src/generators/application/application.js +1 -2
- package/dist/src/generators/application/lib/add-e2e.js +3 -8
- package/dist/src/generators/application/lib/add-linting.js +1 -3
- package/dist/src/generators/application/lib/add-serve-static-target.js +2 -0
- package/dist/src/generators/application/lib/add-unit-test-runner.js +0 -2
- package/dist/src/generators/application/lib/create-project.js +2 -0
- package/dist/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/dist/src/generators/application/lib/normalize-options.js +1 -8
- package/dist/src/generators/application/schema.d.ts +0 -5
- package/dist/src/generators/application/schema.json +1 -7
- package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +9 -4
- package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +1 -2
- package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +0 -63
- package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.d.ts +2 -0
- package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.js +32 -0
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -15
- package/dist/src/generators/init/init.js +1 -2
- package/dist/src/generators/init/schema.d.ts +0 -2
- package/dist/src/generators/library/lib/normalized-schema.d.ts +0 -4
- package/dist/src/generators/library/library.js +3 -4
- package/dist/src/generators/library/schema.d.ts +0 -5
- package/dist/src/generators/library/schema.json +0 -6
- package/dist/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +12 -1
- package/dist/src/generators/ng-add/migrators/projects/app.migrator.d.ts +1 -0
- package/dist/src/generators/ng-add/migrators/projects/app.migrator.js +22 -0
- package/dist/src/generators/ng-add/migrators/projects/e2e.migrator.js +12 -16
- package/dist/src/generators/ng-add/utilities/workspace.js +1 -3
- package/dist/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +15 -1
- package/dist/src/generators/setup-ssr/lib/add-dependencies.js +4 -0
- package/dist/src/generators/setup-ssr/lib/update-project-config.js +1 -0
- package/dist/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
- package/dist/src/generators/utils/add-jest.d.ts +0 -1
- package/dist/src/generators/utils/add-jest.js +0 -2
- package/dist/src/generators/utils/add-vitest.d.ts +0 -1
- package/dist/src/generators/utils/add-vitest.js +0 -1
- package/dist/src/generators/utils/testing.d.ts +4 -4
- package/dist/src/generators/utils/testing.js +19 -12
- package/dist/src/migrations/update-23-1-0/add-angular-build.js +7 -3
- package/dist/src/migrations/update-23-1-0/add-angular-build.md +1 -1
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.js +9 -2
- package/dist/src/migrations/update-24-0-0/add-ready-when-signal.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/add-ready-when-signal.js +12 -0
- package/dist/src/migrations/update-24-0-0/add-ready-when-signal.md +59 -0
- package/dist/src/migrations/update-24-0-0/remove-scam-generator-defaults.d.ts +2 -0
- package/dist/src/migrations/update-24-0-0/remove-scam-generator-defaults.js +85 -0
- package/dist/src/migrations/update-24-0-0/remove-scam-generator-defaults.md +48 -0
- package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.d.ts +5 -0
- package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.js +332 -0
- package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.md +46 -0
- package/dist/src/plugins/plugin.js +3 -5
- package/dist/src/plugins/utils/dev-server-ready-check.d.ts +17 -0
- package/dist/src/plugins/utils/dev-server-ready-check.js +213 -0
- package/dist/src/utils/assert-cypress-component-testing-support.js +10 -0
- package/dist/src/utils/backward-compatible-versions.js +0 -8
- package/dist/src/utils/versions.d.ts +4 -8
- package/dist/src/utils/versions.js +5 -9
- package/dist/types/nx-angular.d.ts +1 -3
- package/executors.json +0 -10
- package/generators.json +0 -59
- package/migrations.json +109 -0
- package/package.json +13 -21
- package/dist/.npmignore +0 -2
- package/dist/fesm2022/nx-angular-mf.mjs +0 -193
- package/dist/fesm2022/nx-angular-mf.mjs.map +0 -1
- package/dist/fesm2022/nx-angular.mjs.map +0 -1
- package/dist/mf/package.json +0 -4
- package/dist/src/builders/utilities/module-federation.d.ts +0 -11
- package/dist/src/builders/utilities/module-federation.js +0 -109
- package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
- package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -22
- package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -111
- package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -38
- package/dist/src/executors/module-federation-dev-server/schema.json +0 -171
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -2
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -20
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.js +0 -30
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -4
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -110
- package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -17
- package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -124
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +0 -4
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.js +0 -36
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +0 -5
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +0 -448
- package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.js +0 -22
- package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +0 -45
- package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +0 -18
- package/dist/src/generators/convert-to-with-mf/lib/index.d.ts +0 -6
- package/dist/src/generators/convert-to-with-mf/lib/index.js +0 -9
- package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +0 -5
- package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +0 -57
- package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +0 -13
- package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +0 -3
- package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +0 -50
- package/dist/src/generators/convert-to-with-mf/schema.d.ts +0 -4
- package/dist/src/generators/convert-to-with-mf/schema.json +0 -33
- package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
- package/dist/src/generators/federate-module/federate-module.js +0 -49
- package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +0 -2
- package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +0 -14
- package/dist/src/generators/federate-module/lib/add-path-to-exposes.d.ts +0 -8
- package/dist/src/generators/federate-module/lib/add-path-to-exposes.js +0 -77
- package/dist/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +0 -8
- package/dist/src/generators/federate-module/lib/add-path-to-ts-config.js +0 -11
- package/dist/src/generators/federate-module/lib/add-remote.d.ts +0 -7
- package/dist/src/generators/federate-module/lib/add-remote.js +0 -42
- package/dist/src/generators/federate-module/lib/check-remote-exists.d.ts +0 -2
- package/dist/src/generators/federate-module/lib/check-remote-exists.js +0 -21
- package/dist/src/generators/federate-module/lib/index.d.ts +0 -4
- package/dist/src/generators/federate-module/lib/index.js +0 -7
- package/dist/src/generators/federate-module/schema.d.ts +0 -13
- package/dist/src/generators/federate-module/schema.json +0 -83
- package/dist/src/generators/host/files/common/src/main.server.ts__tmpl__ +0 -78
- package/dist/src/generators/host/files/js/webpack.server.config.js__tmpl__ +0 -8
- package/dist/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +0 -9
- package/dist/src/generators/host/host.d.ts +0 -4
- package/dist/src/generators/host/host.js +0 -133
- package/dist/src/generators/host/lib/index.d.ts +0 -2
- package/dist/src/generators/host/lib/index.js +0 -5
- package/dist/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
- package/dist/src/generators/host/lib/update-ssr-setup.js +0 -54
- package/dist/src/generators/host/lib/validate-options.d.ts +0 -3
- package/dist/src/generators/host/lib/validate-options.js +0 -12
- package/dist/src/generators/host/schema.d.ts +0 -36
- package/dist/src/generators/host/schema.json +0 -195
- package/dist/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +0 -9
- package/dist/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +0 -9
- package/dist/src/generators/remote/files/common/src/main.server.ts__tmpl__ +0 -84
- package/dist/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +0 -12
- package/dist/src/generators/remote/lib/find-next-available-port.d.ts +0 -2
- package/dist/src/generators/remote/lib/find-next-available-port.js +0 -16
- package/dist/src/generators/remote/lib/index.d.ts +0 -3
- package/dist/src/generators/remote/lib/index.js +0 -6
- package/dist/src/generators/remote/lib/update-ssr-setup.d.ts +0 -9
- package/dist/src/generators/remote/lib/update-ssr-setup.js +0 -82
- package/dist/src/generators/remote/lib/validate-options.d.ts +0 -3
- package/dist/src/generators/remote/lib/validate-options.js +0 -12
- package/dist/src/generators/remote/remote.d.ts +0 -4
- package/dist/src/generators/remote/remote.js +0 -114
- package/dist/src/generators/remote/schema.d.ts +0 -34
- package/dist/src/generators/remote/schema.json +0 -184
- package/dist/src/generators/scam/lib/convert-component-to-scam.d.ts +0 -3
- package/dist/src/generators/scam/lib/convert-component-to-scam.js +0 -41
- package/dist/src/generators/scam/lib/index.d.ts +0 -2
- package/dist/src/generators/scam/lib/index.js +0 -5
- package/dist/src/generators/scam/lib/normalize-options.d.ts +0 -3
- package/dist/src/generators/scam/lib/normalize-options.js +0 -34
- package/dist/src/generators/scam/scam.d.ts +0 -7
- package/dist/src/generators/scam/scam.js +0 -28
- package/dist/src/generators/scam/schema.d.ts +0 -30
- package/dist/src/generators/scam/schema.json +0 -126
- package/dist/src/generators/scam-directive/lib/convert-directive-to-scam.d.ts +0 -3
- package/dist/src/generators/scam-directive/lib/convert-directive-to-scam.js +0 -41
- package/dist/src/generators/scam-directive/lib/index.d.ts +0 -2
- package/dist/src/generators/scam-directive/lib/index.js +0 -5
- package/dist/src/generators/scam-directive/lib/normalize-options.d.ts +0 -3
- package/dist/src/generators/scam-directive/lib/normalize-options.js +0 -34
- package/dist/src/generators/scam-directive/scam-directive.d.ts +0 -7
- package/dist/src/generators/scam-directive/scam-directive.js +0 -28
- package/dist/src/generators/scam-directive/schema.d.ts +0 -23
- package/dist/src/generators/scam-directive/schema.json +0 -89
- package/dist/src/generators/scam-pipe/lib/convert-pipe-to-scam.d.ts +0 -3
- package/dist/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +0 -41
- package/dist/src/generators/scam-pipe/lib/index.d.ts +0 -2
- package/dist/src/generators/scam-pipe/lib/index.js +0 -5
- package/dist/src/generators/scam-pipe/lib/normalize-options.d.ts +0 -3
- package/dist/src/generators/scam-pipe/lib/normalize-options.js +0 -36
- package/dist/src/generators/scam-pipe/scam-pipe.d.ts +0 -7
- package/dist/src/generators/scam-pipe/scam-pipe.js +0 -28
- package/dist/src/generators/scam-pipe/schema.d.ts +0 -21
- package/dist/src/generators/scam-pipe/schema.json +0 -67
- package/dist/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.d.ts +0 -3
- package/dist/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +0 -35
- package/dist/src/generators/scam-to-standalone/lib/get-component-data-from-ast.d.ts +0 -6
- package/dist/src/generators/scam-to-standalone/lib/get-component-data-from-ast.js +0 -15
- package/dist/src/generators/scam-to-standalone/lib/get-module-metadata-from-ast.d.ts +0 -9
- package/dist/src/generators/scam-to-standalone/lib/get-module-metadata-from-ast.js +0 -51
- package/dist/src/generators/scam-to-standalone/lib/get-target-project.d.ts +0 -2
- package/dist/src/generators/scam-to-standalone/lib/get-target-project.js +0 -13
- package/dist/src/generators/scam-to-standalone/lib/index.d.ts +0 -8
- package/dist/src/generators/scam-to-standalone/lib/index.js +0 -11
- package/dist/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.d.ts +0 -2
- package/dist/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.js +0 -20
- package/dist/src/generators/scam-to-standalone/lib/selector-exists-in-ast.d.ts +0 -2
- package/dist/src/generators/scam-to-standalone/lib/selector-exists-in-ast.js +0 -7
- package/dist/src/generators/scam-to-standalone/lib/verify-is-inline-scam.d.ts +0 -2
- package/dist/src/generators/scam-to-standalone/lib/verify-is-inline-scam.js +0 -10
- package/dist/src/generators/scam-to-standalone/lib/verify-module-is-scam.d.ts +0 -1
- package/dist/src/generators/scam-to-standalone/lib/verify-module-is-scam.js +0 -11
- package/dist/src/generators/scam-to-standalone/scam-to-standalone.d.ts +0 -7
- package/dist/src/generators/scam-to-standalone/scam-to-standalone.js +0 -31
- package/dist/src/generators/scam-to-standalone/schema.d.ts +0 -5
- package/dist/src/generators/scam-to-standalone/schema.json +0 -32
- package/dist/src/generators/setup-mf/files/entry-module-files/__entryModuleFileName__.ts__tmpl__ +0 -18
- package/dist/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +0 -4
- package/dist/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +0 -10
- package/dist/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -42
- package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +0 -4
- package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +0 -11
- package/dist/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -27
- package/dist/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
- package/dist/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +0 -9
- package/dist/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +0 -21
- package/dist/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +0 -23
- package/dist/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +0 -9
- package/dist/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +0 -21
- package/dist/src/generators/setup-mf/lib/add-cypress-workaround.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/add-cypress-workaround.js +0 -52
- package/dist/src/generators/setup-mf/lib/add-remote-entry.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/add-remote-entry.js +0 -27
- package/dist/src/generators/setup-mf/lib/add-remote-to-host.d.ts +0 -9
- package/dist/src/generators/setup-mf/lib/add-remote-to-host.js +0 -127
- package/dist/src/generators/setup-mf/lib/change-build-target.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/change-build-target.js +0 -24
- package/dist/src/generators/setup-mf/lib/fix-bootstrap.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/fix-bootstrap.js +0 -40
- package/dist/src/generators/setup-mf/lib/generate-config.d.ts +0 -6
- package/dist/src/generators/setup-mf/lib/generate-config.js +0 -32
- package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.d.ts +0 -6
- package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.js +0 -20
- package/dist/src/generators/setup-mf/lib/index.d.ts +0 -15
- package/dist/src/generators/setup-mf/lib/index.js +0 -18
- package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.d.ts +0 -2
- package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.js +0 -15
- package/dist/src/generators/setup-mf/lib/normalize-options.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/normalize-options.js +0 -26
- package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +0 -61
- package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.js +0 -20
- package/dist/src/generators/setup-mf/lib/setup-serve-target.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/setup-serve-target.js +0 -39
- package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.js +0 -15
- package/dist/src/generators/setup-mf/lib/update-host-app-routes.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/update-host-app-routes.js +0 -39
- package/dist/src/generators/setup-mf/lib/update-tsconfig.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/update-tsconfig.js +0 -18
- package/dist/src/generators/setup-mf/schema.d.ts +0 -35
- package/dist/src/generators/setup-mf/schema.json +0 -99
- package/dist/src/generators/setup-mf/setup-mf.d.ts +0 -4
- package/dist/src/generators/setup-mf/setup-mf.js +0 -90
- package/dist/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/dist/src/generators/utils/add-mf-env-to-inputs.js +0 -36
- package/dist/src/generators/utils/assert-mf-utils.d.ts +0 -1
- package/dist/src/generators/utils/assert-mf-utils.js +0 -8
- package/dist/src/generators/utils/export-scam.d.ts +0 -11
- package/dist/src/generators/utils/export-scam.js +0 -35
- package/dist/src/utils/get-mf-projects.d.ts +0 -4
- package/dist/src/utils/get-mf-projects.js +0 -31
- package/dist/src/utils/module-federation-deprecation.d.ts +0 -4
- package/dist/src/utils/module-federation-deprecation.js +0 -29
- package/dist/types/nx-angular-mf.d.ts +0 -72
- package/dist/types/nx-angular-mf.d.ts.map +0 -1
- package/dist/types/nx-angular.d.ts.map +0 -1
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"title": "Schema for Module Federation Dev Server",
|
|
4
|
-
"x-deprecated": "The `@nx/angular:module-federation-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": "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.",
|
|
8
|
-
"type": "object",
|
|
9
|
-
"presets": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Using a Different Port",
|
|
12
|
-
"keys": ["buildTarget", "port"]
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"properties": {
|
|
16
|
-
"buildTarget": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "A build builder target to serve in the format of `project:target[:configuration]`.",
|
|
19
|
-
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
|
|
20
|
-
},
|
|
21
|
-
"port": {
|
|
22
|
-
"type": "number",
|
|
23
|
-
"description": "Port to listen on.",
|
|
24
|
-
"default": 4200
|
|
25
|
-
},
|
|
26
|
-
"host": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"description": "Host to listen on.",
|
|
29
|
-
"default": "localhost"
|
|
30
|
-
},
|
|
31
|
-
"proxyConfig": {
|
|
32
|
-
"type": "string",
|
|
33
|
-
"description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server."
|
|
34
|
-
},
|
|
35
|
-
"ssl": {
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"description": "Serve using HTTPS.",
|
|
38
|
-
"default": false
|
|
39
|
-
},
|
|
40
|
-
"sslKey": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"description": "SSL key to use for serving HTTPS."
|
|
43
|
-
},
|
|
44
|
-
"sslCert": {
|
|
45
|
-
"type": "string",
|
|
46
|
-
"description": "SSL certificate to use for serving HTTPS."
|
|
47
|
-
},
|
|
48
|
-
"headers": {
|
|
49
|
-
"type": "object",
|
|
50
|
-
"description": "Custom HTTP headers to be added to all responses.",
|
|
51
|
-
"propertyNames": {
|
|
52
|
-
"pattern": "^[-_A-Za-z0-9]+$"
|
|
53
|
-
},
|
|
54
|
-
"additionalProperties": {
|
|
55
|
-
"type": "string"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"open": {
|
|
59
|
-
"type": "boolean",
|
|
60
|
-
"description": "Opens the url in default browser.",
|
|
61
|
-
"default": false,
|
|
62
|
-
"alias": "o"
|
|
63
|
-
},
|
|
64
|
-
"verbose": {
|
|
65
|
-
"type": "boolean",
|
|
66
|
-
"description": "Adds more details to output logging."
|
|
67
|
-
},
|
|
68
|
-
"liveReload": {
|
|
69
|
-
"type": "boolean",
|
|
70
|
-
"description": "Whether to reload the page on change, using live-reload.",
|
|
71
|
-
"default": true
|
|
72
|
-
},
|
|
73
|
-
"publicHost": {
|
|
74
|
-
"type": "string",
|
|
75
|
-
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
|
|
76
|
-
},
|
|
77
|
-
"allowedHosts": {
|
|
78
|
-
"type": "array",
|
|
79
|
-
"description": "List of hosts that are allowed to access the dev server.",
|
|
80
|
-
"default": [],
|
|
81
|
-
"items": {
|
|
82
|
-
"type": "string"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"servePath": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"description": "The pathname where the app will be served."
|
|
88
|
-
},
|
|
89
|
-
"disableHostCheck": {
|
|
90
|
-
"type": "boolean",
|
|
91
|
-
"description": "Don't verify connected clients are part of allowed hosts.",
|
|
92
|
-
"default": false
|
|
93
|
-
},
|
|
94
|
-
"hmr": {
|
|
95
|
-
"type": "boolean",
|
|
96
|
-
"description": "Enable hot module replacement.",
|
|
97
|
-
"default": false
|
|
98
|
-
},
|
|
99
|
-
"watch": {
|
|
100
|
-
"type": "boolean",
|
|
101
|
-
"description": "Rebuild on change.",
|
|
102
|
-
"default": true
|
|
103
|
-
},
|
|
104
|
-
"poll": {
|
|
105
|
-
"type": "number",
|
|
106
|
-
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
107
|
-
},
|
|
108
|
-
"devRemotes": {
|
|
109
|
-
"type": "array",
|
|
110
|
-
"items": {
|
|
111
|
-
"oneOf": [
|
|
112
|
-
{
|
|
113
|
-
"type": "string"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"type": "object",
|
|
117
|
-
"properties": {
|
|
118
|
-
"remoteName": {
|
|
119
|
-
"type": "string"
|
|
120
|
-
},
|
|
121
|
-
"configuration": {
|
|
122
|
-
"type": "string"
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"required": ["remoteName"],
|
|
126
|
-
"additionalProperties": false
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
|
131
|
-
"x-priority": "important"
|
|
132
|
-
},
|
|
133
|
-
"skipRemotes": {
|
|
134
|
-
"type": "array",
|
|
135
|
-
"items": {
|
|
136
|
-
"type": "string"
|
|
137
|
-
},
|
|
138
|
-
"description": "List of remote applications to not automatically serve, either statically or in development mode. This will not remove the remotes from the `module-federation.config` file, and therefore the application may still try to fetch these remotes.\nThis option is useful if you have other means for serving the `remote` application(s).\n**NOTE:** Remotes that are not in the workspace will be skipped automatically."
|
|
139
|
-
},
|
|
140
|
-
"pathToManifestFile": {
|
|
141
|
-
"type": "string",
|
|
142
|
-
"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."
|
|
143
|
-
},
|
|
144
|
-
"static": {
|
|
145
|
-
"type": "boolean",
|
|
146
|
-
"description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for remote applications that are also host applications."
|
|
147
|
-
},
|
|
148
|
-
"isInitialHost": {
|
|
149
|
-
"type": "boolean",
|
|
150
|
-
"description": "Whether the host that is running this executor is the first in the project tree to do so.",
|
|
151
|
-
"default": true,
|
|
152
|
-
"x-priority": "internal"
|
|
153
|
-
},
|
|
154
|
-
"parallel": {
|
|
155
|
-
"type": "number",
|
|
156
|
-
"description": "Max number of parallel processes for building static remotes"
|
|
157
|
-
},
|
|
158
|
-
"staticRemotesPort": {
|
|
159
|
-
"type": "number",
|
|
160
|
-
"description": "The port at which to serve the file-server for the static remotes."
|
|
161
|
-
},
|
|
162
|
-
"buildLibsFromSource": {
|
|
163
|
-
"type": "boolean",
|
|
164
|
-
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `buildTarget` options, or it will default to `true` if it's also not set in the `buildTarget` options.",
|
|
165
|
-
"x-priority": "important"
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
"additionalProperties": false,
|
|
169
|
-
"required": ["buildTarget"],
|
|
170
|
-
"examplesFile": "../../../docs/module-federation-dev-server-examples.md"
|
|
171
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
function normalizeOptions(options) {
|
|
7
|
-
const devServeRemotes = !options.devRemotes
|
|
8
|
-
? []
|
|
9
|
-
: Array.isArray(options.devRemotes)
|
|
10
|
-
? options.devRemotes
|
|
11
|
-
: [options.devRemotes];
|
|
12
|
-
return {
|
|
13
|
-
...options,
|
|
14
|
-
devRemotes: devServeRemotes,
|
|
15
|
-
verbose: options.verbose ?? false,
|
|
16
|
-
ssl: options.ssl ?? false,
|
|
17
|
-
sslCert: options.sslCert ? (0, path_1.join)(devkit_1.workspaceRoot, options.sslCert) : undefined,
|
|
18
|
-
sslKey: options.sslKey ? (0, path_1.join)(devkit_1.workspaceRoot, options.sslKey) : undefined,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -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): Promise<AsyncIterable<{
|
|
4
|
-
success: boolean;
|
|
5
|
-
}>[]>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startRemotes = startRemotes;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function startRemotes(remotes, workspaceProjects, options, context) {
|
|
6
|
-
const target = 'serve-ssr';
|
|
7
|
-
const remoteIters = [];
|
|
8
|
-
for (const app of remotes) {
|
|
9
|
-
if (!workspaceProjects[app].targets?.[target]) {
|
|
10
|
-
throw new Error(`Could not find "${target}" target in "${app}" project.`);
|
|
11
|
-
}
|
|
12
|
-
else if (!workspaceProjects[app].targets?.[target].executor) {
|
|
13
|
-
throw new Error(`Could not find executor for "${target}" target in "${app}" project.`);
|
|
14
|
-
}
|
|
15
|
-
const [_, executor] = workspaceProjects[app].targets[target].executor.split(':');
|
|
16
|
-
const isUsingModuleFederationSsrDevServerExecutor = executor.includes('module-federation-dev-ssr');
|
|
17
|
-
const configurationOverride = options.devRemotes.find((r) => typeof r !== 'string' && r.remoteName === app)?.configuration;
|
|
18
|
-
remoteIters.push(await (0, devkit_1.runExecutor)({
|
|
19
|
-
project: app,
|
|
20
|
-
target,
|
|
21
|
-
configuration: configurationOverride ?? context.configurationName,
|
|
22
|
-
}, {
|
|
23
|
-
...{ verbose: options.verbose ?? false },
|
|
24
|
-
...(isUsingModuleFederationSsrDevServerExecutor
|
|
25
|
-
? { isInitialHost: false }
|
|
26
|
-
: {}),
|
|
27
|
-
}, context));
|
|
28
|
-
}
|
|
29
|
-
return remoteIters;
|
|
30
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import type { Schema } from './schema';
|
|
3
|
-
export declare function moduleFederationSsrDevServerExecutor(schema: Schema, context: ExecutorContext): AsyncGenerator<import("@angular-devkit/build-angular").SSRDevServerBuilderOutput, any, any>;
|
|
4
|
-
export default moduleFederationSsrDevServerExecutor;
|
package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
DELETED
|
@@ -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,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";
|