@nx/angular 23.0.0-beta.2 → 23.0.0-beta.20
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/generators.d.ts +0 -2
- package/generators.d.ts.map +1 -1
- package/generators.js +0 -2
- package/generators.json +0 -13
- package/migrations.json +19 -536
- package/package.json +9 -11
- package/plugins/component-testing.js +8 -8
- package/src/builders/utilities/buildable-libs.d.ts +1 -1
- package/src/builders/utilities/buildable-libs.d.ts.map +1 -1
- package/src/builders/utilities/buildable-libs.js +3 -3
- package/src/builders/utilities/module-federation.d.ts.map +1 -1
- package/src/builders/utilities/module-federation.js +9 -11
- package/src/builders/utilities/webpack.d.ts.map +1 -1
- package/src/builders/utilities/webpack.js +3 -7
- package/src/executors/delegate-build/delegate-build.impl.js +3 -3
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +4 -5
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +4 -5
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +2 -2
- package/src/executors/package/package.impl.d.ts +1 -1
- package/src/executors/package/package.impl.d.ts.map +1 -1
- package/src/executors/package/package.impl.js +5 -5
- package/src/executors/utilities/angular-version-utils.d.ts.map +1 -1
- package/src/executors/utilities/angular-version-utils.js +3 -8
- package/src/executors/utilities/buildable-libs.d.ts +1 -1
- package/src/executors/utilities/buildable-libs.d.ts.map +1 -1
- package/src/executors/utilities/buildable-libs.js +3 -3
- package/src/executors/utilities/esbuild-extensions.d.ts.map +1 -1
- package/src/executors/utilities/esbuild-extensions.js +5 -24
- package/src/executors/utilities/module-loader.d.ts +1 -1
- package/src/executors/utilities/module-loader.d.ts.map +1 -1
- package/src/executors/utilities/module-loader.js +24 -20
- package/src/generators/add-linting/add-linting.d.ts.map +1 -1
- package/src/generators/add-linting/add-linting.js +17 -17
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts.map +1 -1
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +4 -5
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +7 -4
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +5 -7
- package/src/generators/application/lib/add-unit-test-runner.d.ts +2 -2
- package/src/generators/application/lib/add-unit-test-runner.d.ts.map +1 -1
- package/src/generators/application/lib/add-unit-test-runner.js +5 -5
- package/src/generators/application/lib/create-project.d.ts.map +1 -1
- package/src/generators/application/lib/create-project.js +3 -3
- package/src/generators/application/lib/normalize-options.js +3 -3
- package/src/generators/application/lib/update-tsconfig-files.js +3 -3
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +2 -0
- package/src/generators/component/lib/component.js +2 -2
- package/src/generators/component/lib/normalize-options.js +2 -2
- package/src/generators/component-story/component-story.d.ts.map +1 -1
- package/src/generators/component-story/component-story.js +2 -0
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +2 -0
- package/src/generators/convert-to-application-executor/convert-to-application-executor.d.ts.map +1 -1
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +2 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts.map +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.js +5 -4
- package/src/generators/convert-to-rspack/lib/create-config.js +1 -1
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +2 -2
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts.map +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +5 -0
- package/src/generators/convert-to-with-mf/lib/check-name-matches.js +2 -2
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +2 -2
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +4 -4
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +2 -2
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +8 -6
- package/src/generators/directive/directive.d.ts.map +1 -1
- package/src/generators/directive/directive.js +2 -0
- package/src/generators/directive/lib/normalize-options.js +2 -2
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +2 -0
- package/src/generators/federate-module/lib/add-path-to-exposes.js +6 -6
- package/src/generators/federate-module/lib/add-remote.js +2 -2
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +10 -7
- package/src/generators/host/lib/update-ssr-setup.js +2 -2
- package/src/generators/host/schema.d.ts +1 -0
- package/src/generators/host/schema.json +4 -0
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +4 -2
- package/src/generators/library/lib/add-children.js +2 -2
- package/src/generators/library/lib/add-load-children.js +2 -2
- package/src/generators/library/lib/add-project.js +4 -4
- package/src/generators/library/lib/create-files.js +2 -2
- package/src/generators/library/lib/normalize-options.js +3 -3
- package/src/generators/library/lib/update-tsconfig-files.js +3 -3
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +16 -11
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.d.ts.map +1 -1
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +2 -0
- package/src/generators/move/lib/update-module-name.js +2 -2
- package/src/generators/ng-add/migrators/migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/migrator.js +10 -5
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +6 -6
- package/src/generators/ng-add/ng-add.d.ts.map +1 -1
- package/src/generators/ng-add/ng-add.js +2 -0
- package/src/generators/ng-add/utilities/workspace.js +8 -8
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +2 -2
- package/src/generators/ngrx-feature-store/lib/add-imports.js +2 -2
- package/src/generators/ngrx-feature-store/lib/normalize-options.js +5 -5
- package/src/generators/ngrx-feature-store/ngrx-feature-store.d.ts.map +1 -1
- package/src/generators/ngrx-feature-store/ngrx-feature-store.js +2 -0
- package/src/generators/ngrx-root-store/lib/add-imports.js +2 -2
- package/src/generators/ngrx-root-store/lib/normalize-options.js +5 -5
- package/src/generators/ngrx-root-store/ngrx-root-store.d.ts.map +1 -1
- package/src/generators/ngrx-root-store/ngrx-root-store.js +2 -0
- package/src/generators/pipe/lib/normalize-options.js +2 -2
- package/src/generators/pipe/pipe.d.ts.map +1 -1
- package/src/generators/pipe/pipe.js +2 -0
- package/src/generators/remote/lib/update-ssr-setup.js +2 -2
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +7 -5
- package/src/generators/scam/lib/convert-component-to-scam.js +2 -2
- package/src/generators/scam/lib/normalize-options.js +2 -2
- package/src/generators/scam/scam.d.ts.map +1 -1
- package/src/generators/scam/scam.js +2 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +2 -2
- package/src/generators/scam-directive/lib/normalize-options.js +2 -2
- package/src/generators/scam-directive/scam-directive.d.ts.map +1 -1
- package/src/generators/scam-directive/scam-directive.js +2 -0
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +2 -2
- package/src/generators/scam-pipe/lib/normalize-options.js +2 -2
- package/src/generators/scam-pipe/scam-pipe.d.ts.map +1 -1
- package/src/generators/scam-pipe/scam-pipe.js +2 -0
- package/src/generators/scam-to-standalone/scam-to-standalone.d.ts.map +1 -1
- package/src/generators/scam-to-standalone/scam-to-standalone.js +2 -0
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +3 -3
- package/src/generators/setup-mf/lib/add-remote-to-host.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +5 -6
- package/src/generators/setup-mf/lib/change-build-target.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/change-build-target.js +2 -2
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +2 -2
- package/src/generators/setup-mf/setup-mf.d.ts.map +1 -1
- package/src/generators/setup-mf/setup-mf.js +8 -0
- package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-hydration.js +3 -4
- package/src/generators/setup-ssr/lib/add-server-file.js +2 -2
- package/src/generators/setup-ssr/lib/generate-files.js +2 -2
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +2 -2
- package/src/generators/setup-ssr/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/normalize-options.js +2 -2
- package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +19 -7
- package/src/generators/setup-ssr/setup-ssr.d.ts.map +1 -1
- package/src/generators/setup-ssr/setup-ssr.js +2 -0
- package/src/generators/stories/stories.d.ts.map +1 -1
- package/src/generators/stories/stories.js +2 -0
- package/src/generators/storybook-configuration/storybook-configuration.d.ts.map +1 -1
- package/src/generators/storybook-configuration/storybook-configuration.js +2 -0
- package/src/generators/utils/add-mf-env-to-inputs.d.ts.map +1 -1
- package/src/generators/utils/add-mf-env-to-inputs.js +16 -9
- package/src/generators/utils/add-vitest.d.ts +3 -3
- package/src/generators/utils/add-vitest.d.ts.map +1 -1
- package/src/generators/utils/add-vitest.js +41 -26
- package/src/generators/utils/app-components-info.js +2 -2
- package/src/generators/utils/find-module.js +2 -2
- package/src/generators/utils/insert-ngmodule-import.js +6 -6
- package/src/generators/utils/storybook-ast/component-info.js +5 -5
- package/src/generators/utils/storybook-ast/module-info.js +9 -9
- package/src/generators/utils/storybook-ast/storybook-inputs.js +4 -4
- package/src/generators/utils/testing.js +2 -2
- package/src/generators/utils/tsconfig-utils.js +2 -2
- package/src/generators/utils/validations.js +2 -2
- package/src/generators/utils/version-utils.d.ts.map +1 -1
- package/src/generators/utils/version-utils.js +2 -7
- package/src/generators/web-worker/web-worker.d.ts.map +1 -1
- package/src/generators/web-worker/web-worker.js +2 -0
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.d.ts.map +1 -1
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.js +26 -19
- package/src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone.js +8 -8
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +2 -2
- package/src/migrations/update-20-2-0/remove-angular-eslint-rules.js +6 -6
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.js +45 -12
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts.map +1 -1
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +2 -2
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +2 -2
- package/src/migrations/update-21-5-0/utils/karma-config-analyzer.js +2 -2
- package/src/migrations/update-22-3-0/update-module-resolution.js +2 -2
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +2 -2
- package/src/migrations/{update-17-2-0/rename-webpack-dev-server.d.ts → update-23-0-0/migrate-ngrx-generator-defaults.d.ts} +1 -1
- package/src/migrations/update-23-0-0/migrate-ngrx-generator-defaults.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-ngrx-generator-defaults.js +120 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.d.ts +3 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.js +45 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +54 -22
- package/src/utils/assert-supported-angular-version.d.ts +3 -0
- package/src/utils/assert-supported-angular-version.d.ts.map +1 -0
- package/src/utils/assert-supported-angular-version.js +9 -0
- package/src/utils/backward-compatible-versions.js +2 -2
- package/src/utils/get-mf-projects.js +3 -3
- package/src/utils/index.d.ts +1 -0
- package/src/utils/index.d.ts.map +1 -1
- package/src/utils/index.js +3 -1
- package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
- package/src/utils/nx-devkit/ast-utils.js +17 -18
- package/src/utils/nx-devkit/route-utils.js +3 -3
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +8 -3
- package/tailwind.js +2 -2
- package/module-federation/index.d.ts +0 -6
- package/module-federation/index.d.ts.map +0 -1
- package/module-federation/index.js +0 -6
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +0 -16
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts.map +0 -1
- package/src/generators/add-linting/lib/create-eslint-configuration.js +0 -121
- package/src/generators/move/move.d.ts +0 -7
- package/src/generators/move/move.d.ts.map +0 -1
- package/src/generators/move/move.js +0 -11
- package/src/generators/move/schema.d.ts +0 -8
- package/src/generators/move/schema.json +0 -56
- package/src/generators/ngrx/files/__directory__/__fileName__.actions.ts__tmpl__ +0 -16
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +0 -37
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -103
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
- package/src/generators/ngrx/files/__directory__/__fileName__.models.ts__tmpl__ +0 -7
- package/src/generators/ngrx/files/__directory__/__fileName__.reducer.spec.ts__tmpl__ +0 -37
- package/src/generators/ngrx/files/__directory__/__fileName__.reducer.ts__tmpl__ +0 -41
- package/src/generators/ngrx/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +0 -58
- package/src/generators/ngrx/files/__directory__/__fileName__.selectors.ts__tmpl__ +0 -38
- package/src/generators/ngrx/lib/add-exports-barrel.d.ts +0 -7
- package/src/generators/ngrx/lib/add-exports-barrel.d.ts.map +0 -1
- package/src/generators/ngrx/lib/add-exports-barrel.js +0 -44
- package/src/generators/ngrx/lib/add-imports-to-module.d.ts +0 -4
- package/src/generators/ngrx/lib/add-imports-to-module.d.ts.map +0 -1
- package/src/generators/ngrx/lib/add-imports-to-module.js +0 -181
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts +0 -4
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts.map +0 -1
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +0 -23
- package/src/generators/ngrx/lib/generate-files.d.ts +0 -7
- package/src/generators/ngrx/lib/generate-files.d.ts.map +0 -1
- package/src/generators/ngrx/lib/generate-files.js +0 -23
- package/src/generators/ngrx/lib/index.d.ts +0 -7
- package/src/generators/ngrx/lib/index.d.ts.map +0 -1
- package/src/generators/ngrx/lib/index.js +0 -15
- package/src/generators/ngrx/lib/normalize-options.d.ts +0 -9
- package/src/generators/ngrx/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/ngrx/lib/normalize-options.js +0 -30
- package/src/generators/ngrx/lib/validate-options.d.ts +0 -4
- package/src/generators/ngrx/lib/validate-options.d.ts.map +0 -1
- package/src/generators/ngrx/lib/validate-options.js +0 -14
- package/src/generators/ngrx/ngrx.d.ts +0 -8
- package/src/generators/ngrx/ngrx.d.ts.map +0 -1
- package/src/generators/ngrx/ngrx.js +0 -28
- package/src/generators/ngrx/schema.d.ts +0 -14
- package/src/generators/ngrx/schema.json +0 -102
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +0 -4
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +0 -50
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +0 -3
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +0 -75
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +0 -3
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +0 -184
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/update-angular-cli.js +0 -14
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts +0 -3
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts.map +0 -1
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +0 -37
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts.map +0 -1
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +0 -40
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts +0 -3
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts.map +0 -1
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.js +0 -25
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts +0 -3
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts.map +0 -1
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.js +0 -25
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-17-3-0/update-angular-cli.js +0 -14
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +0 -3
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts.map +0 -1
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +0 -26
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-18-1-0/update-angular-cli.js +0 -14
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -3
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts.map +0 -1
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-18-2-0/update-angular-cli.js +0 -14
- package/src/migrations/update-19-1-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-19-1-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-19-1-0/update-angular-cli.js +0 -14
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isHostRemoteConfig = isHostRemoteConfig;
|
|
4
4
|
exports.getRemotesFromHost = getRemotesFromHost;
|
|
5
5
|
exports.getExposedModulesFromRemote = getExposedModulesFromRemote;
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const REMOTES_EXPRESSION_SELECTOR = 'PropertyAssignment:has(Identifier[name=remotes]) > ObjectLiteralExpression';
|
|
8
8
|
const EXPOSES_EXPRESSION_SELECTOR = 'PropertyAssignment:has(Identifier[name=exposes]) > ObjectLiteralExpression';
|
|
9
9
|
const PROPERTY_SELECTOR = 'ObjectLiteralExpression > PropertyAssignment';
|
|
10
10
|
function isHostRemoteConfig(sourceFile) {
|
|
11
11
|
let isHost = false;
|
|
12
12
|
let isRemote = false;
|
|
13
|
-
(0,
|
|
13
|
+
(0, internal_1.ensureTypescript)();
|
|
14
14
|
const { query } = require('@phenomnomnominal/tsquery');
|
|
15
15
|
const remotesNodes = query(sourceFile, REMOTES_EXPRESSION_SELECTOR);
|
|
16
16
|
if (remotesNodes.length > 0) {
|
|
@@ -24,7 +24,7 @@ function isHostRemoteConfig(sourceFile) {
|
|
|
24
24
|
return result;
|
|
25
25
|
}
|
|
26
26
|
function getRemotesFromHost(sourceFile) {
|
|
27
|
-
(0,
|
|
27
|
+
(0, internal_1.ensureTypescript)();
|
|
28
28
|
const { query } = require('@phenomnomnominal/tsquery');
|
|
29
29
|
const remotesObjectNodes = query(sourceFile, REMOTES_EXPRESSION_SELECTOR);
|
|
30
30
|
if (remotesObjectNodes.length === 0) {
|
|
@@ -47,7 +47,7 @@ function getRemotesFromHost(sourceFile) {
|
|
|
47
47
|
return remotes;
|
|
48
48
|
}
|
|
49
49
|
function getExposedModulesFromRemote(sourceFile) {
|
|
50
|
-
(0,
|
|
50
|
+
(0, internal_1.ensureTypescript)();
|
|
51
51
|
const { query } = require('@phenomnomnominal/tsquery');
|
|
52
52
|
const exposesObjectNodes = query(sourceFile, EXPOSES_EXPRESSION_SELECTOR);
|
|
53
53
|
if (exposesObjectNodes.length === 0) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseASTOfWebpackConfig = parseASTOfWebpackConfig;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/js/internal");
|
|
5
5
|
function parseASTOfWebpackConfig(tree, pathToWebpackConfig) {
|
|
6
6
|
if (!tree.exists(pathToWebpackConfig)) {
|
|
7
7
|
throw new Error(`Cannot migrate webpack config at \`${pathToWebpackConfig}\` as it does not exist. Please ensure this file exists and that the path to the file is correct.`);
|
|
8
8
|
}
|
|
9
|
-
(0,
|
|
9
|
+
(0, internal_1.ensureTypescript)();
|
|
10
10
|
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
11
11
|
const source = tree.read(pathToWebpackConfig, 'utf-8');
|
|
12
12
|
return tsquery.ast(source);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.writeNewWebpackConfig = writeNewWebpackConfig;
|
|
4
4
|
const is_host_remote_config_1 = require("./is-host-remote-config");
|
|
5
5
|
function writeNewWebpackConfig(ast, mfType, projectName) {
|
|
6
|
-
const webpackConfig = `const { withModuleFederation } = require('@nx/
|
|
6
|
+
const webpackConfig = `const { withModuleFederation } = require('@nx/module-federation/angular');
|
|
7
7
|
const config = require('./module-federation.config');
|
|
8
8
|
module.exports = withModuleFederation(config);
|
|
9
9
|
`;
|
package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress-component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,iBAAiB,EAMjB,IAAI,EAEL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cypress-component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,iBAAiB,EAMjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAapB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAiBxD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,iBAAiB,CAAC,CAqD5B;AAkJD,eAAe,6BAA6B,CAAC"}
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.cypressComponentConfiguration = cypressComponentConfiguration;
|
|
37
37
|
const devkit_1 = require("@nx/devkit");
|
|
38
38
|
const path_1 = require("path");
|
|
39
|
+
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
39
40
|
const zoneless_1 = require("../../utils/zoneless");
|
|
40
41
|
const versions_1 = require("../../utils/versions");
|
|
41
42
|
const component_test_1 = require("../component-test/component-test");
|
|
@@ -61,6 +62,7 @@ const esbuildExecutors = new Set([
|
|
|
61
62
|
* storybook + cypress then use the componentCypressGenerator instead.
|
|
62
63
|
*/
|
|
63
64
|
async function cypressComponentConfiguration(tree, options) {
|
|
65
|
+
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
64
66
|
const { componentConfigurationGenerator: baseCyCTConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
65
67
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
66
68
|
let isZoneless;
|
|
@@ -73,7 +75,7 @@ async function cypressComponentConfiguration(tree, options) {
|
|
|
73
75
|
isZoneless = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'zone.js') === null;
|
|
74
76
|
}
|
|
75
77
|
if (isZoneless) {
|
|
76
|
-
const { getInstalledCypressVersion } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/
|
|
78
|
+
const { getInstalledCypressVersion } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/internal')));
|
|
77
79
|
const installedCypressVersion = getInstalledCypressVersion(tree);
|
|
78
80
|
// Zoneless support was introduced in Cypress 15.8.0
|
|
79
81
|
// If Cypress is not yet installed, we'll install the latest version, which will have zoneless support
|
|
@@ -103,7 +105,7 @@ async function cypressComponentConfiguration(tree, options) {
|
|
|
103
105
|
}
|
|
104
106
|
async function addFiles(tree, projectConfig, options, isZoneless) {
|
|
105
107
|
const componentFile = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress', 'support', 'component.ts');
|
|
106
|
-
const { addMountDefinition } = require('@nx/cypress/
|
|
108
|
+
const { addMountDefinition } = (require('@nx/cypress/internal'));
|
|
107
109
|
const updatedCmpContents = await addMountDefinition(tree.read(componentFile, 'utf-8'));
|
|
108
110
|
tree.write(componentFile, `import { mount } from '${isZoneless ? 'cypress/angular-zoneless' : 'cypress/angular'}';\n${updatedCmpContents}`);
|
|
109
111
|
if (!options.generateTests) {
|
|
@@ -141,7 +143,7 @@ async function addFiles(tree, projectConfig, options, isZoneless) {
|
|
|
141
143
|
async function configureCypressCT(tree, options) {
|
|
142
144
|
let found = { target: options.buildTarget, config: undefined };
|
|
143
145
|
if (!options.buildTarget) {
|
|
144
|
-
const { findBuildConfig } = require('@nx/cypress/
|
|
146
|
+
const { findBuildConfig } = (require('@nx/cypress/internal'));
|
|
145
147
|
found = await findBuildConfig(tree, {
|
|
146
148
|
project: options.project,
|
|
147
149
|
buildTarget: options.buildTarget,
|
|
@@ -179,9 +181,9 @@ async function configureCypressCT(tree, options) {
|
|
|
179
181
|
else {
|
|
180
182
|
ctConfigOptions.buildTarget = found.target;
|
|
181
183
|
}
|
|
182
|
-
const { addDefaultCTConfig, getProjectCypressConfigPath } = require('@nx/cypress/
|
|
184
|
+
const { addDefaultCTConfig, getProjectCypressConfigPath } = require('@nx/cypress/internal');
|
|
183
185
|
const cypressConfigPath = getProjectCypressConfigPath(tree, projectConfig.root);
|
|
184
|
-
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigPath, 'utf-8'), ctConfigOptions);
|
|
185
|
-
tree.write(cypressConfigPath,
|
|
186
|
+
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigPath, 'utf-8'), ctConfigOptions, '@nx/angular/plugins/component-testing');
|
|
187
|
+
tree.write(cypressConfigPath, updatedCyConfig);
|
|
186
188
|
}
|
|
187
189
|
exports.default = cypressComponentConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/directive/directive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/directive/directive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBA8ClE;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.directiveGenerator = directiveGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
5
6
|
const utils_1 = require("../utils");
|
|
6
7
|
const version_utils_1 = require("../utils/version-utils");
|
|
7
8
|
const lib_1 = require("./lib");
|
|
8
9
|
async function directiveGenerator(tree, schema) {
|
|
10
|
+
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
9
11
|
const options = await (0, lib_1.normalizeOptions)(tree, schema);
|
|
10
12
|
const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
11
13
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.directory, {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const selector_1 = require("../../utils/selector");
|
|
7
7
|
const validations_1 = require("../../utils/validations");
|
|
8
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
@@ -11,7 +11,7 @@ async function normalizeOptions(tree, options) {
|
|
|
11
11
|
if (angularMajorVersion < 20) {
|
|
12
12
|
options.type ??= 'directive';
|
|
13
13
|
}
|
|
14
|
-
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0,
|
|
14
|
+
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
15
15
|
name: options.name,
|
|
16
16
|
path: options.path,
|
|
17
17
|
suffix: options.type,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"federate-module.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/federate-module/federate-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"federate-module.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/federate-module/federate-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAUpB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mDAiDvE;AAED,eAAe,uBAAuB,CAAC"}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.federateModuleGenerator = federateModuleGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
5
6
|
const test_runners_1 = require("../../utils/test-runners");
|
|
6
7
|
const version_utils_1 = require("../utils/version-utils");
|
|
7
8
|
const lib_1 = require("./lib");
|
|
8
9
|
async function federateModuleGenerator(tree, schema) {
|
|
10
|
+
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
9
11
|
if (!tree.exists(schema.path)) {
|
|
10
12
|
throw new Error((0, devkit_1.stripIndents) `The "path" provided does not exist. Please verify the path is correct and pointing to a file that exists in the workspace.
|
|
11
13
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addPathToExposes = addPathToExposes;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
let tsModule;
|
|
7
7
|
function addPathToExposes(tree, { projectPath, moduleName, modulePath }) {
|
|
8
8
|
const moduleFederationConfigPath = (0, devkit_1.joinPathFragments)(projectPath, tree.exists((0, devkit_1.joinPathFragments)(projectPath, 'module-federation.config.ts'))
|
|
@@ -12,7 +12,7 @@ function addPathToExposes(tree, { projectPath, moduleName, modulePath }) {
|
|
|
12
12
|
}
|
|
13
13
|
function updateExposesProperty(tree, moduleFederationConfigPath, moduleName, modulePath) {
|
|
14
14
|
if (!tsModule) {
|
|
15
|
-
tsModule = (0,
|
|
15
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
16
16
|
}
|
|
17
17
|
const fileContent = tree.read(moduleFederationConfigPath, 'utf-8');
|
|
18
18
|
const source = tsModule.createSourceFile(moduleFederationConfigPath, fileContent, tsModule.ScriptTarget.ES2015, true);
|
|
@@ -25,7 +25,7 @@ function updateExposesProperty(tree, moduleFederationConfigPath, moduleName, mod
|
|
|
25
25
|
}
|
|
26
26
|
function findExposes(sourceFile) {
|
|
27
27
|
if (!tsModule) {
|
|
28
|
-
tsModule = (0,
|
|
28
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
29
29
|
}
|
|
30
30
|
let exposesObject = null;
|
|
31
31
|
const visit = (node) => {
|
|
@@ -45,14 +45,14 @@ function findExposes(sourceFile) {
|
|
|
45
45
|
// Create a new property assignment
|
|
46
46
|
function createObjectEntry(moduleName, modulePath) {
|
|
47
47
|
if (!tsModule) {
|
|
48
|
-
tsModule = (0,
|
|
48
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
49
49
|
}
|
|
50
50
|
return tsModule.factory.createPropertyAssignment(tsModule.factory.createStringLiteral(`./${moduleName}`, true), tsModule.factory.createStringLiteral(modulePath, true));
|
|
51
51
|
}
|
|
52
52
|
// Update the exposes property in the AST
|
|
53
53
|
function updateExposesPropertyinAST(source, exposesObject, newEntry) {
|
|
54
54
|
if (!tsModule) {
|
|
55
|
-
tsModule = (0,
|
|
55
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
56
56
|
}
|
|
57
57
|
const updatedExposes = tsModule.factory.updateObjectLiteralExpression(exposesObject, [...exposesObject.properties, newEntry]);
|
|
58
58
|
const transform = (context) => {
|
|
@@ -69,7 +69,7 @@ function updateExposesPropertyinAST(source, exposesObject, newEntry) {
|
|
|
69
69
|
// Write the updated AST to the file (module-federation.config.js)
|
|
70
70
|
function writeToConfig(tree, filename, source, updatedSourceFile) {
|
|
71
71
|
if (!tsModule) {
|
|
72
|
-
tsModule = (0,
|
|
72
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
73
73
|
}
|
|
74
74
|
const printer = tsModule.createPrinter();
|
|
75
75
|
const update = printer.printNode(tsModule.EmitHint.Unspecified, updatedSourceFile, source);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addRemote = addRemote;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const test_runners_1 = require("../../../utils/test-runners");
|
|
7
7
|
const remote_1 = tslib_1.__importDefault(require("../../remote/remote"));
|
|
8
8
|
const check_remote_exists_1 = require("./check-remote-exists");
|
|
@@ -21,7 +21,7 @@ async function addRemote(tree, schema) {
|
|
|
21
21
|
skipFormat: true,
|
|
22
22
|
});
|
|
23
23
|
tasks.push(remoteGeneratorCallback);
|
|
24
|
-
const { projectName, projectRoot: remoteRoot } = await (0,
|
|
24
|
+
const { projectName, projectRoot: remoteRoot } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
25
25
|
name: schema.remote,
|
|
26
26
|
directory: schema.remoteDirectory,
|
|
27
27
|
projectType: 'application',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/host/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/host/host.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,IAAI,EAEL,MAAM,YAAY,CAAC;AAapB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,mDAmIpD;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.host = host;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
7
7
|
const js_1 = require("@nx/js");
|
|
8
|
+
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
8
9
|
const test_runners_1 = require("../../utils/test-runners");
|
|
9
10
|
const application_1 = tslib_1.__importDefault(require("../application/application"));
|
|
10
11
|
const convert_to_rspack_1 = tslib_1.__importDefault(require("../convert-to-rspack/convert-to-rspack"));
|
|
@@ -16,6 +17,7 @@ const validations_1 = require("../utils/validations");
|
|
|
16
17
|
const version_utils_1 = require("../utils/version-utils");
|
|
17
18
|
const lib_1 = require("./lib");
|
|
18
19
|
async function host(tree, schema) {
|
|
20
|
+
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
19
21
|
(0, validations_1.assertNotUsingTsSolutionSetup)(tree, 'host');
|
|
20
22
|
(0, lib_1.validateOptions)(tree, schema);
|
|
21
23
|
// TODO: Replace with Rspack when confidence is high enough
|
|
@@ -49,17 +51,18 @@ async function host(tree, schema) {
|
|
|
49
51
|
}
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
|
-
await (0,
|
|
53
|
-
const { projectName: hostProjectName, projectRoot: appRoot } = await (0,
|
|
54
|
+
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
55
|
+
const { projectName: hostProjectName, projectRoot: appRoot } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
54
56
|
name: options.name,
|
|
55
57
|
projectType: 'application',
|
|
56
58
|
directory: options.directory,
|
|
57
59
|
});
|
|
60
|
+
const hostPort = options.port ?? 4200;
|
|
58
61
|
const appInstallTask = await (0, application_1.default)(tree, {
|
|
59
62
|
...options,
|
|
60
63
|
standalone: options.standalone,
|
|
61
64
|
routing: true,
|
|
62
|
-
port:
|
|
65
|
+
port: hostPort,
|
|
63
66
|
skipFormat: true,
|
|
64
67
|
bundler: 'webpack',
|
|
65
68
|
});
|
|
@@ -68,7 +71,7 @@ async function host(tree, schema) {
|
|
|
68
71
|
appName: hostProjectName,
|
|
69
72
|
mfType: 'host',
|
|
70
73
|
routing: true,
|
|
71
|
-
port:
|
|
74
|
+
port: hostPort,
|
|
72
75
|
remotes: remotesToIntegrate ?? [],
|
|
73
76
|
federationType: options.dynamic ? 'dynamic' : 'static',
|
|
74
77
|
skipPackageJson: options.skipPackageJson,
|
|
@@ -97,7 +100,7 @@ async function host(tree, schema) {
|
|
|
97
100
|
name: remote,
|
|
98
101
|
directory: remoteDirectory,
|
|
99
102
|
host: hostProjectName,
|
|
100
|
-
port: isRspack ?
|
|
103
|
+
port: isRspack ? hostPort + i + 1 : undefined,
|
|
101
104
|
skipFormat: true,
|
|
102
105
|
standalone: options.standalone,
|
|
103
106
|
typescriptConfiguration,
|
|
@@ -114,7 +117,7 @@ async function host(tree, schema) {
|
|
|
114
117
|
const project = (0, devkit_1.readProjectConfiguration)(tree, hostProjectName);
|
|
115
118
|
project.targets.serve ??= {};
|
|
116
119
|
project.targets.serve.options ??= {};
|
|
117
|
-
project.targets.serve.options.port =
|
|
120
|
+
project.targets.serve.options.port = hostPort;
|
|
118
121
|
(0, devkit_1.updateProjectConfiguration)(tree, hostProjectName, project);
|
|
119
122
|
if (!options.skipFormat) {
|
|
120
123
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateSsrSetup = updateSsrSetup;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/js/internal");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const versions_1 = require("../../../utils/versions");
|
|
8
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
9
9
|
async function updateSsrSetup(tree, options, appName, typescriptConfiguration) {
|
|
10
10
|
let project = (0, devkit_1.readProjectConfiguration)(tree, appName);
|
|
11
|
-
const sourceRoot = (0,
|
|
11
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(project, tree);
|
|
12
12
|
tree.rename((0, devkit_1.joinPathFragments)(sourceRoot, 'main.server.ts'), (0, devkit_1.joinPathFragments)(sourceRoot, 'bootstrap.server.ts'));
|
|
13
13
|
const pathToServerEntry = (0, devkit_1.joinPathFragments)(sourceRoot, 'server.ts');
|
|
14
14
|
tree.write(pathToServerEntry, `import('./main.server');`);
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"default": "webpack",
|
|
44
44
|
"enum": ["webpack", "rspack"]
|
|
45
45
|
},
|
|
46
|
+
"port": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"description": "The port at which the Consumer (host) application should be served. Defaults to 4200."
|
|
49
|
+
},
|
|
46
50
|
"dynamic": {
|
|
47
51
|
"type": "boolean",
|
|
48
52
|
"description": "Should the host application use dynamic federation?",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/init/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,iBAAiB,EAItB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,CAAC,CA+B5B;AA2ED,eAAe,oBAAoB,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.angularInitGenerator = angularInitGenerator;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
6
6
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
|
+
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
7
8
|
const validations_1 = require("../utils/validations");
|
|
8
9
|
const version_utils_1 = require("../utils/version-utils");
|
|
9
10
|
async function angularInitGenerator(tree, options) {
|
|
11
|
+
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
10
12
|
(0, validations_1.assertNotUsingTsSolutionSetup)(tree, 'init');
|
|
11
13
|
ignoreAngularCacheDirectory(tree);
|
|
12
14
|
const installTask = installAngularDevkitCoreIfMissing(tree, options);
|
|
@@ -16,7 +18,7 @@ async function angularInitGenerator(tree, options) {
|
|
|
16
18
|
// by most folks we've talked to.
|
|
17
19
|
options.addPlugin ??= process.env.NX_RUNNING_NX_IMPORT === 'true';
|
|
18
20
|
if (options.addPlugin) {
|
|
19
|
-
await (0,
|
|
21
|
+
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/angular/plugin', plugin_1.createNodesV2, {
|
|
20
22
|
targetNamePrefix: ['', 'angular:', 'angular-'],
|
|
21
23
|
}, options.updatePackageScripts);
|
|
22
24
|
}
|
|
@@ -5,14 +5,14 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
6
|
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
7
7
|
const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
let tsModule;
|
|
10
10
|
function addChildren(tree, options) {
|
|
11
11
|
if (!tree.exists(options.parent)) {
|
|
12
12
|
throw new Error(`Cannot find '${options.parent}'`);
|
|
13
13
|
}
|
|
14
14
|
if (!tsModule) {
|
|
15
|
-
tsModule = (0,
|
|
15
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
16
16
|
}
|
|
17
17
|
const routeFileSource = tree.read(options.parent, 'utf-8');
|
|
18
18
|
const constName = options.standalone
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addLoadChildren = addLoadChildren;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
let tsModule;
|
|
8
8
|
function addLoadChildren(tree, options) {
|
|
9
9
|
if (!tree.exists(options.parent)) {
|
|
10
10
|
throw new Error(`Cannot find '${options.parent}'`);
|
|
11
11
|
}
|
|
12
12
|
if (!tsModule) {
|
|
13
|
-
tsModule = (0,
|
|
13
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
14
14
|
}
|
|
15
15
|
const moduleSource = tree.read(options.parent, 'utf-8');
|
|
16
16
|
const sourceFile = tsModule.createSourceFile(options.parent, moduleSource, tsModule.ScriptTarget.Latest, true);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProject = addProject;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function addProject(tree, libraryOptions) {
|
|
8
8
|
const project = {
|
|
9
9
|
name: libraryOptions.name,
|
|
@@ -18,7 +18,7 @@ async function addProject(tree, libraryOptions) {
|
|
|
18
18
|
const executor = libraryOptions.publishable
|
|
19
19
|
? '@nx/angular:package'
|
|
20
20
|
: '@nx/angular:ng-packagr-lite';
|
|
21
|
-
(0,
|
|
21
|
+
(0, internal_1.addBuildTargetDefaults)(tree, executor);
|
|
22
22
|
project.targets.build = {
|
|
23
23
|
executor,
|
|
24
24
|
outputs: ['{workspaceRoot}/dist/{projectRoot}'],
|
|
@@ -36,7 +36,7 @@ async function addProject(tree, libraryOptions) {
|
|
|
36
36
|
};
|
|
37
37
|
if (libraryOptions.publishable) {
|
|
38
38
|
const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, internal_2.addReleaseConfigForNonTsSolution)(tree, libraryOptions.name, project);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
(0, devkit_1.addProjectConfiguration)(tree, libraryOptions.name, project);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createFiles = createFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const test_runners_1 = require("../../../utils/test-runners");
|
|
9
9
|
const version_utils_1 = require("../../utils/version-utils");
|
|
@@ -51,7 +51,7 @@ function createFiles(tree, options, project) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
if (!options.libraryOptions.routing) {
|
|
54
|
-
tree.delete((0, devkit_1.joinPathFragments)((0,
|
|
54
|
+
tree.delete((0, devkit_1.joinPathFragments)((0, internal_1.getProjectSourceRoot)(project, tree), `lib/lib.routes.ts`));
|
|
55
55
|
}
|
|
56
56
|
if (!options.libraryOptions.buildable &&
|
|
57
57
|
!options.libraryOptions.publishable) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const test_runners_1 = require("../../../utils/test-runners");
|
|
7
7
|
const artifact_types_1 = require("../../utils/artifact-types");
|
|
8
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
@@ -21,8 +21,8 @@ async function normalizeOptions(host, schema) {
|
|
|
21
21
|
skipModule: schema.skipModule || schema.standalone,
|
|
22
22
|
...schema,
|
|
23
23
|
};
|
|
24
|
-
await (0,
|
|
25
|
-
const { projectName, names: projectNames, projectRoot, importPath, } = await (0,
|
|
24
|
+
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
25
|
+
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
26
26
|
name: options.name,
|
|
27
27
|
projectType: 'library',
|
|
28
28
|
directory: options.directory,
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.updateTsConfigFiles = updateTsConfigFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const tsconfig_utils_1 = require("../../utils/tsconfig-utils");
|
|
9
9
|
const update_project_root_tsconfig_1 = require("../../utils/update-project-root-tsconfig");
|
|
@@ -59,7 +59,7 @@ function updateTsConfigFiles(tree, options) {
|
|
|
59
59
|
...json.compilerOptions,
|
|
60
60
|
...compilerOptions,
|
|
61
61
|
};
|
|
62
|
-
json.compilerOptions = (0,
|
|
62
|
+
json.compilerOptions = (0, internal_1.getNeededCompilerOptionOverrides)(tree, json.compilerOptions, rootTsConfigPath);
|
|
63
63
|
if (options.strict) {
|
|
64
64
|
json.angularCompilerOptions = {
|
|
65
65
|
...json.angularCompilerOptions,
|
|
@@ -79,7 +79,7 @@ function updateTsConfigFiles(tree, options) {
|
|
|
79
79
|
module: 'commonjs',
|
|
80
80
|
moduleResolution: 'node10',
|
|
81
81
|
};
|
|
82
|
-
json.compilerOptions = (0,
|
|
82
|
+
json.compilerOptions = (0, internal_1.getNeededCompilerOptionOverrides)(tree, json.compilerOptions, tsconfigPath);
|
|
83
83
|
return json;
|
|
84
84
|
});
|
|
85
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library/library.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library/library.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AAuBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAqE5B;AAoED,eAAe,gBAAgB,CAAC"}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.libraryGenerator = libraryGenerator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
7
7
|
const js_1 = require("@nx/js");
|
|
8
|
-
const
|
|
8
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
9
|
const init_1 = tslib_1.__importDefault(require("../../generators/init/init"));
|
|
10
|
+
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
10
11
|
const test_runners_1 = require("../../utils/test-runners");
|
|
11
12
|
const add_linting_1 = tslib_1.__importDefault(require("../add-linting/add-linting"));
|
|
12
13
|
const add_jest_1 = require("../utils/add-jest");
|
|
@@ -25,6 +26,7 @@ const update_lib_package_npm_scope_1 = require("./lib/update-lib-package-npm-sco
|
|
|
25
26
|
const update_tsconfig_files_1 = require("./lib/update-tsconfig-files");
|
|
26
27
|
const validate_options_1 = require("./lib/validate-options");
|
|
27
28
|
async function libraryGenerator(tree, schema) {
|
|
29
|
+
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
28
30
|
(0, validations_1.assertNotUsingTsSolutionSetup)(tree, 'library');
|
|
29
31
|
(0, validate_options_1.validateOptions)(tree, schema);
|
|
30
32
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
@@ -43,7 +45,7 @@ async function libraryGenerator(tree, schema) {
|
|
|
43
45
|
}
|
|
44
46
|
const project = await (0, add_project_1.addProject)(tree, libraryOptions);
|
|
45
47
|
(0, create_files_1.createFiles)(tree, options, project);
|
|
46
|
-
await addUnitTestRunner(tree, libraryOptions);
|
|
48
|
+
const unitTestRunnerTask = await addUnitTestRunner(tree, libraryOptions);
|
|
47
49
|
(0, update_tsconfig_files_1.updateTsConfigFiles)(tree, libraryOptions);
|
|
48
50
|
updateNpmScopeIfBuildableOrPublishable(tree, libraryOptions);
|
|
49
51
|
(0, set_generator_defaults_1.setGeneratorDefaults)(tree, options);
|
|
@@ -64,11 +66,14 @@ async function libraryGenerator(tree, schema) {
|
|
|
64
66
|
if (!libraryOptions.skipFormat) {
|
|
65
67
|
await (0, devkit_1.formatFiles)(tree);
|
|
66
68
|
}
|
|
67
|
-
const tasks = [
|
|
69
|
+
const tasks = [
|
|
70
|
+
unitTestRunnerTask,
|
|
71
|
+
() => (0, devkit_1.installPackagesTask)(tree),
|
|
72
|
+
];
|
|
68
73
|
if (libraryOptions.publishable) {
|
|
69
|
-
tasks.push(await (0,
|
|
74
|
+
tasks.push(await (0, internal_2.releaseTasks)(tree));
|
|
70
75
|
}
|
|
71
|
-
tasks.push(() => (0,
|
|
76
|
+
tasks.push(() => (0, internal_1.logShowProjectCommand)(libraryOptions.name));
|
|
72
77
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
73
78
|
}
|
|
74
79
|
async function addUnitTestRunner(host, options) {
|
|
@@ -83,17 +88,16 @@ async function addUnitTestRunner(host, options) {
|
|
|
83
88
|
runtimeTsconfigFileName: 'tsconfig.lib.json',
|
|
84
89
|
zoneless,
|
|
85
90
|
});
|
|
86
|
-
|
|
91
|
+
return () => { };
|
|
87
92
|
case test_runners_1.UnitTestRunner.VitestAngular:
|
|
88
|
-
|
|
93
|
+
return (0, add_vitest_1.addVitestAngular)(host, {
|
|
89
94
|
name: options.name,
|
|
90
95
|
projectRoot: options.projectRoot,
|
|
91
96
|
skipPackageJson: options.skipPackageJson,
|
|
92
97
|
useNxUnitTestRunnerExecutor: true,
|
|
93
98
|
});
|
|
94
|
-
break;
|
|
95
99
|
case test_runners_1.UnitTestRunner.VitestAnalog:
|
|
96
|
-
|
|
100
|
+
return (0, add_vitest_1.addVitestAnalog)(host, {
|
|
97
101
|
name: options.name,
|
|
98
102
|
projectRoot: options.projectRoot,
|
|
99
103
|
skipFormat: options.skipFormat,
|
|
@@ -101,7 +105,8 @@ async function addUnitTestRunner(host, options) {
|
|
|
101
105
|
strict: options.strict,
|
|
102
106
|
zoneless,
|
|
103
107
|
});
|
|
104
|
-
|
|
108
|
+
default:
|
|
109
|
+
return () => { };
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
function updateNpmScopeIfBuildableOrPublishable(host, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-secondary-entry-point.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"library-secondary-entry-point.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/library-secondary-entry-point/library-secondary-entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,YAAY,CAAC;AAQ/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAsB,mCAAmC,CACvD,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,gBAAgB,iBAY7B;AAED,eAAe,mCAAmC,CAAC"}
|