@nx/angular 0.0.0-pr-31222-862e973 → 0.0.0-pr-31313-387cdca
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/LICENSE +1 -1
- package/README.md +1 -1
- package/executors.d.ts +1 -6
- package/executors.js +2 -3
- package/executors.json +2 -2
- package/fesm2022/nx-angular-mf.mjs +64 -0
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs +0 -352
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.d.ts +0 -1
- package/generators.js +0 -1
- package/generators.json +19 -18
- package/index.d.ts +1 -1
- package/mf/mf.d.ts +64 -0
- package/migrations.json +778 -1289
- package/module-federation/index.d.ts +5 -2
- package/module-federation/index.js +3 -4
- package/ng-package.json +2 -2
- package/package.json +17 -29
- package/src/builders/dev-server/dev-server.impl.js +6 -4
- package/src/builders/dev-server/lib/normalize-options.js +3 -0
- package/src/builders/dev-server/lib/validate-options.js +1 -9
- package/src/builders/dev-server/schema.d.ts +3 -0
- package/src/builders/dev-server/schema.json +8 -8
- package/src/builders/webpack-browser/schema.d.ts +0 -5
- package/src/builders/webpack-browser/schema.json +0 -2
- package/src/builders/webpack-browser/webpack-browser.impl.js +3 -4
- package/src/builders/webpack-server/schema.json +0 -1
- package/src/executors/application/application.impl.d.ts +1 -1
- package/src/executors/application/application.impl.js +4 -1
- package/src/executors/application/schema.json +78 -8
- package/src/executors/application/utils/normalize-options.d.ts +2 -0
- package/src/executors/application/utils/normalize-options.js +34 -0
- package/src/executors/application/utils/validate-options.js +18 -4
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +1 -1
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +0 -9
- package/src/executors/browser-esbuild/schema.json +1 -3
- package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -3
- package/src/executors/delegate-build/delegate-build.impl.js +0 -3
- package/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
- package/src/executors/module-federation-dev-server/lib/index.js +0 -2
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +1 -0
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +5 -31
- package/src/executors/module-federation-dev-server/schema.d.ts +4 -0
- package/src/executors/module-federation-dev-server/schema.json +2 -1
- package/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +2 -2
- package/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +1 -0
- package/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.d.ts +1 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +1 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +7 -35
- package/src/executors/module-federation-ssr-dev-server/schema.d.ts +8 -14
- package/src/executors/module-federation-ssr-dev-server/schema.json +1 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts +3 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js +22 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.d.ts +2 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.js +17 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+/ng-package → ng-package}/entry-point/write-bundles.transform.d.ts +3 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +49 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +2 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +7 -26
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.d.ts +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +1 -1
- package/src/executors/ng-packagr-lite/schema.json +3 -7
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +2 -3
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +4 -21
- package/src/executors/package/package.impl.d.ts +2 -2
- package/src/executors/package/package.impl.js +6 -4
- package/src/executors/package/schema.d.ts +4 -6
- package/src/executors/package/schema.json +4 -10
- package/src/executors/utilities/ng-packagr/ng-packagr-version.d.ts +2 -0
- package/src/executors/utilities/ng-packagr/ng-packagr-version.js +11 -0
- package/src/executors/utilities/ng-packagr/package-imports.d.ts +1 -0
- package/src/executors/utilities/ng-packagr/package-imports.js +10 -0
- package/src/executors/utilities/ng-packagr/{stylesheet-processor.js → pre-v19/stylesheet-processor.js} +4 -4
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts +1 -1
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +23 -14
- package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +0 -6
- package/src/executors/utilities/ng-packagr/tailwindcss.js +0 -32
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts +14 -0
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +99 -0
- package/src/generators/add-linting/add-linting.js +2 -17
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
- package/src/generators/add-linting/lib/create-eslint-configuration.js +2 -2
- package/src/generators/add-linting/schema.d.ts +1 -0
- package/src/generators/application/application.d.ts +0 -1
- package/src/generators/application/application.js +24 -9
- package/src/generators/application/files/ng-module/src/app/app.component.html__tpl__ +8 -1
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +4 -5
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
- package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +72 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.html__tpl__ +8 -1
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +4 -6
- package/src/generators/application/lib/add-e2e.js +2 -9
- package/src/generators/application/lib/add-linting.js +2 -2
- package/src/generators/application/lib/add-serve-static-target.d.ts +1 -1
- package/src/generators/application/lib/add-serve-static-target.js +2 -3
- package/src/generators/application/lib/add-unit-test-runner.js +20 -7
- package/src/generators/application/lib/create-files.js +4 -1
- package/src/generators/application/lib/create-project.js +25 -31
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +14 -15
- package/src/generators/application/schema.d.ts +5 -6
- package/src/generators/application/schema.json +16 -21
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +4 -7
- package/src/generators/component/files/__fileName__.__style__ +1 -1
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
- package/src/generators/component/files/__fileName__.ts__tpl__ +5 -13
- package/src/generators/component/lib/normalize-options.js +8 -6
- package/src/generators/component/schema.d.ts +3 -18
- package/src/generators/component/schema.json +11 -28
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +4 -4
- package/src/generators/component-test/component-test.js +1 -1
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +1 -4
- package/src/generators/convert-to-application-executor/schema.json +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts +4 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.js +357 -0
- package/src/generators/convert-to-rspack/lib/create-config.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/create-config.js +45 -0
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +6 -0
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +77 -0
- package/src/generators/convert-to-rspack/lib/update-tsconfig.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/update-tsconfig.js +26 -0
- package/src/generators/convert-to-rspack/lib/validate-supported-executor.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/validate-supported-executor.js +14 -0
- package/src/generators/convert-to-rspack/schema.d.ts +5 -0
- package/src/generators/convert-to-rspack/schema.json +30 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -7
- package/src/generators/directive/directive.js +5 -0
- package/src/generators/directive/files/__fileName__.ts__tpl__ +2 -2
- package/src/generators/directive/lib/normalize-options.js +6 -7
- package/src/generators/directive/schema.d.ts +2 -17
- package/src/generators/directive/schema.json +20 -28
- package/src/generators/federate-module/lib/add-remote.js +0 -3
- package/src/generators/federate-module/schema.d.ts +0 -2
- package/src/generators/federate-module/schema.json +19 -16
- package/src/generators/host/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
- package/src/generators/host/files/js/webpack.server.config.js__tmpl__ +1 -1
- package/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/host.d.ts +1 -2
- package/src/generators/host/host.js +33 -25
- package/src/generators/host/lib/update-ssr-setup.js +7 -3
- package/src/generators/host/schema.d.ts +4 -5
- package/src/generators/host/schema.json +34 -27
- package/src/generators/init/init.js +3 -1
- package/src/generators/library/files/base/README.md__tpl__ +2 -2
- package/src/generators/library/lib/add-project.d.ts +1 -1
- package/src/generators/library/lib/add-project.js +7 -1
- package/src/generators/library/lib/add-standalone-component.js +4 -3
- package/src/generators/library/lib/normalize-options.js +4 -5
- package/src/generators/library/lib/normalized-schema.d.ts +2 -3
- package/src/generators/library/library.d.ts +0 -1
- package/src/generators/library/library.js +27 -19
- package/src/generators/library/schema.d.ts +2 -5
- package/src/generators/library/schema.json +9 -20
- package/src/generators/move/lib/update-secondary-entry-points.js +1 -0
- package/src/generators/move/move.d.ts +3 -1
- package/src/generators/move/move.js +4 -8
- package/src/generators/move/schema.d.ts +0 -3
- package/src/generators/move/schema.json +0 -5
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +1 -1
- package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.js +4 -3
- package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +1 -1
- package/src/generators/ng-add/migrators/builders/builder.migrator.d.ts +2 -2
- package/src/generators/ng-add/migrators/builders/builder.migrator.js +4 -4
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +4 -4
- package/src/generators/ng-add/migrators/projects/project.migrator.js +1 -1
- package/src/generators/ng-add/utilities/validation-logging.js +5 -4
- package/src/generators/ng-add/utilities/workspace.js +5 -2
- package/src/generators/ngrx/ngrx.d.ts +3 -0
- package/src/generators/ngrx/ngrx.js +3 -0
- package/src/generators/ngrx/schema.json +1 -1
- package/src/generators/ngrx-feature-store/schema.d.ts +1 -1
- package/src/generators/ngrx-root-store/lib/add-imports.js +4 -4
- package/src/generators/ngrx-root-store/lib/normalize-options.js +3 -2
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +2 -2
- package/src/generators/pipe/lib/normalize-options.js +6 -7
- package/src/generators/pipe/pipe.js +5 -0
- package/src/generators/pipe/schema.d.ts +2 -17
- package/src/generators/pipe/schema.json +20 -28
- package/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +1 -1
- package/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
- package/src/generators/remote/lib/update-ssr-setup.js +7 -3
- package/src/generators/remote/remote.d.ts +1 -2
- package/src/generators/remote/remote.js +38 -14
- package/src/generators/remote/schema.d.ts +4 -5
- package/src/generators/remote/schema.json +32 -25
- package/src/generators/scam/lib/normalize-options.js +6 -7
- package/src/generators/scam/scam.js +0 -2
- package/src/generators/scam/schema.d.ts +3 -17
- package/src/generators/scam/schema.json +16 -30
- package/src/generators/scam-directive/lib/normalize-options.js +6 -7
- package/src/generators/scam-directive/scam-directive.js +0 -2
- package/src/generators/scam-directive/schema.d.ts +3 -17
- package/src/generators/scam-directive/schema.json +16 -31
- package/src/generators/scam-pipe/lib/normalize-options.js +6 -7
- package/src/generators/scam-pipe/scam-pipe.js +0 -2
- package/src/generators/scam-pipe/schema.d.ts +3 -17
- package/src/generators/scam-pipe/schema.json +16 -31
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.d.ts +1 -1
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +5 -4
- package/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.js +3 -1
- package/src/generators/setup-mf/files/entry-module-files/entry.component.ts__tmpl__ +2 -1
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.component.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +4 -1
- package/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +3 -0
- package/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +1 -1
- package/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js +5 -0
- package/src/generators/setup-mf/lib/add-remote-to-host.js +21 -8
- package/src/generators/setup-mf/lib/fix-bootstrap.js +3 -2
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -0
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.js +1 -1
- package/src/generators/setup-mf/schema.json +5 -3
- package/src/generators/setup-mf/setup-mf.js +5 -2
- package/src/generators/setup-ssr/files/{server → pre-v19/server}/application-builder/__serverFileName__ +1 -1
- package/src/generators/setup-ssr/files/{server/server-builder/v17+ → pre-v19/server/server-builder}/__serverFileName__ +1 -1
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/__main__ +1 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/__rootModuleFileName__ +13 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +8 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/server/__serverFileName__ +66 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/__main__ +7 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +14 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +8 -0
- package/src/generators/setup-ssr/files/v19+/application-builder-common-engine/server/__serverFileName__ +67 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/ngmodule-src/__main__ +1 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/ngmodule-src/app/__rootModuleFileName__ +14 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/root/tsconfig.server.json.template +16 -0
- package/src/generators/setup-ssr/files/{server/server-builder/pre-v17 → v19+/server-builder/server}/__serverFileName__ +25 -15
- package/src/generators/setup-ssr/files/v19+/server-builder/standalone-src/__main__ +7 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/standalone-src/app/app.config.server.ts.template +11 -0
- package/src/generators/setup-ssr/lib/add-dependencies.js +6 -17
- package/src/generators/setup-ssr/lib/add-hydration.d.ts +2 -2
- package/src/generators/setup-ssr/lib/add-hydration.js +10 -2
- package/src/generators/setup-ssr/lib/add-server-file.d.ts +2 -2
- package/src/generators/setup-ssr/lib/add-server-file.js +24 -10
- package/src/generators/setup-ssr/lib/generate-files.d.ts +2 -2
- package/src/generators/setup-ssr/lib/generate-files.js +31 -8
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +3 -3
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +24 -3
- package/src/generators/setup-ssr/lib/normalize-options.d.ts +3 -14
- package/src/generators/setup-ssr/lib/normalize-options.js +27 -6
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +2 -2
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +3 -3
- package/src/generators/setup-ssr/lib/update-project-config.js +37 -24
- package/src/generators/setup-ssr/lib/validate-options.js +5 -0
- package/src/generators/setup-ssr/schema.d.ts +5 -0
- package/src/generators/setup-ssr/schema.json +6 -8
- package/src/generators/setup-ssr/setup-ssr.js +6 -11
- package/src/generators/setup-tailwind/lib/index.d.ts +1 -1
- package/src/generators/setup-tailwind/lib/index.js +1 -1
- package/src/generators/setup-tailwind/lib/update-application-styles.js +1 -1
- package/src/generators/setup-tailwind/lib/validate-build-target.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/{add-tailwind-config-path-to-project.js → validate-build-target.js} +5 -15
- package/src/generators/setup-tailwind/setup-tailwind.js +4 -1
- package/src/generators/stories/schema.d.ts +0 -2
- package/src/generators/stories/schema.json +0 -10
- package/src/generators/stories/stories.js +2 -21
- package/src/generators/storybook-configuration/lib/generate-stories.js +0 -6
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
- package/src/generators/storybook-configuration/schema.d.ts +0 -3
- package/src/generators/storybook-configuration/schema.json +0 -15
- package/src/generators/storybook-configuration/storybook-configuration.js +0 -3
- package/src/generators/utils/add-jest.d.ts +1 -0
- package/src/generators/utils/add-jest.js +5 -9
- package/src/generators/utils/add-vitest.d.ts +9 -0
- package/src/generators/utils/add-vitest.js +21 -0
- package/src/generators/utils/assert-mf-utils.d.ts +1 -0
- package/src/generators/utils/assert-mf-utils.js +11 -0
- package/src/generators/utils/ensure-angular-dependencies.js +0 -1
- package/src/generators/utils/storybook-ast/component-info.js +13 -3
- package/src/generators/utils/testing.js +15 -28
- package/src/generators/utils/validations.d.ts +1 -0
- package/src/generators/utils/validations.js +10 -0
- package/src/generators/utils/version-utils.d.ts +1 -0
- package/src/generators/utils/version-utils.js +7 -2
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +4 -4
- package/src/migrations/update-19-6-0/turn-off-dts-by-default.js +2 -2
- package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.d.ts +3 -0
- package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.js +55 -0
- package/src/migrations/{update-14-2-0/remove-show-circular-dependencies-option.d.ts → update-20-2-0/disable-angular-eslint-prefer-standalone.d.ts} +1 -1
- package/src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone.js +55 -0
- package/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.d.ts +2 -0
- package/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.js +61 -0
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts +2 -0
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +41 -0
- package/src/migrations/update-20-2-0/remove-angular-eslint-rules.d.ts +3 -0
- package/src/migrations/update-20-2-0/remove-angular-eslint-rules.js +62 -0
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.d.ts +3 -0
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.js +73 -0
- package/src/migrations/{update-14-5-2 → update-20-2-0}/update-angular-cli.d.ts +1 -0
- package/src/migrations/{update-16-1-0 → update-20-2-0}/update-angular-cli.js +1 -1
- package/src/migrations/{update-14-2-0/update-libraries-secondary-entrypoints.d.ts → update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.d.ts} +1 -1
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.js +55 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts +2 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +18 -0
- package/src/migrations/{update-14-2-0 → update-20-4-0}/update-angular-cli.d.ts +1 -0
- package/src/migrations/{update-14-2-0 → update-20-4-0}/update-angular-cli.js +4 -3
- package/src/migrations/{update-14-6-0 → update-20-5-0}/update-angular-cli.d.ts +1 -0
- package/src/migrations/{update-14-5-2 → update-20-5-0}/update-angular-cli.js +4 -3
- package/src/migrations/{update-14-2-0/update-ngcc-target.d.ts → update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.d.ts} +1 -1
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +122 -0
- package/src/migrations/update-21-0-0/set-continuous-option.d.ts +3 -0
- package/src/migrations/update-21-0-0/set-continuous-option.js +29 -0
- package/src/plugins/plugin.js +7 -2
- package/src/utils/backward-compatible-versions.d.ts +4 -4
- package/src/utils/backward-compatible-versions.js +27 -23
- package/src/utils/nx-devkit/ast-utils.d.ts +3 -2
- package/src/utils/nx-devkit/ast-utils.js +22 -4
- package/src/utils/test-runners.d.ts +2 -1
- package/src/utils/test-runners.js +1 -0
- package/src/utils/versions.d.ts +13 -11
- package/src/utils/versions.js +14 -12
- package/esm2022/index.mjs +0 -2
- package/esm2022/mf/index.mjs +0 -2
- package/esm2022/mf/mf.mjs +0 -52
- package/esm2022/mf/nx-angular-mf.mjs +0 -5
- package/esm2022/nx-angular.mjs +0 -5
- package/esm2022/src/runtime/nx/data-persistence.mjs +0 -349
- package/esm2022/testing/index.mjs +0 -2
- package/esm2022/testing/nx-angular-testing.mjs +0 -5
- package/esm2022/testing/src/testing-utils.mjs +0 -38
- package/fesm2022/nx-angular-testing.mjs +0 -45
- package/fesm2022/nx-angular-testing.mjs.map +0 -1
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.d.ts +0 -4
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.js +0 -65
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.d.ts +0 -9
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +0 -51
- package/src/executors/module-federation-ssr-dev-server/lib/build-static-remotes.d.ts +0 -4
- package/src/executors/module-federation-ssr-dev-server/lib/build-static-remotes.js +0 -65
- package/src/executors/module-federation-ssr-dev-server/lib/start-static-remotes.d.ts +0 -4
- package/src/executors/module-federation-ssr-dev-server/lib/start-static-remotes.js +0 -41
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.d.ts +0 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.js +0 -27
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.d.ts +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.js +0 -53
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.d.ts +0 -15
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.js +0 -28
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.d.ts +0 -30
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.js +0 -52
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.d.ts +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.js +0 -20
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.d.ts +0 -9
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.js +0 -320
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.d.ts +0 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js +0 -35
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.d.ts +0 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.js +0 -37
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.js +0 -178
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.d.ts +0 -42
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.d.ts +0 -10
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.js +0 -17
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.js +0 -201
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.d.ts +0 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.js +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.js +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.d.ts +0 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.js +0 -18
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.d.ts +0 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.js +0 -286
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.d.ts +0 -14
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.js +0 -26
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.d.ts +0 -12
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +0 -71
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.d.ts +0 -13
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.js +0 -32
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.d.ts +0 -14
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +0 -35
- package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.d.ts +0 -14
- package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.js +0 -37
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +0 -13
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +0 -183
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +0 -36
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.d.ts +0 -10
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.js +0 -17
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -194
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.d.ts +0 -1
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +0 -9
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +0 -4
- package/src/generators/component-cypress-spec/component-cypress-spec.js +0 -35
- package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +0 -17
- package/src/generators/component-cypress-spec/lib/get-args-default-value.d.ts +0 -2
- package/src/generators/component-cypress-spec/lib/get-args-default-value.js +0 -24
- package/src/generators/component-cypress-spec/lib/get-component-selector.d.ts +0 -2
- package/src/generators/component-cypress-spec/lib/get-component-selector.js +0 -23
- package/src/generators/component-cypress-spec/schema.d.ts +0 -10
- package/src/generators/component-cypress-spec/schema.json +0 -66
- package/src/generators/host/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -66
- package/src/generators/remote/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -72
- package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.d.ts +0 -3
- package/src/generators/stories/lib/get-e2e-project.d.ts +0 -2
- package/src/generators/stories/lib/get-e2e-project.js +0 -14
- package/src/generators/storybook-configuration/lib/validate-options.d.ts +0 -2
- package/src/generators/storybook-configuration/lib/validate-options.js +0 -8
- package/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.js +0 -23
- package/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.js +0 -34
- package/src/migrations/update-14-2-0/update-ngcc-target.js +0 -17
- package/src/migrations/update-14-2-0/update-router-initial-navigation.d.ts +0 -2
- package/src/migrations/update-14-2-0/update-router-initial-navigation.js +0 -73
- package/src/migrations/update-14-2-0/update-tsconfig-target.d.ts +0 -2
- package/src/migrations/update-14-2-0/update-tsconfig-target.js +0 -155
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.d.ts +0 -5
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js +0 -90
- package/src/migrations/update-14-6-0/update-angular-cli.js +0 -22
- package/src/migrations/update-14-8-0/rename-webpack-server.d.ts +0 -2
- package/src/migrations/update-14-8-0/rename-webpack-server.js +0 -21
- package/src/migrations/update-15-0-0/add-karma-inputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/add-karma-inputs.js +0 -41
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.d.ts +0 -2
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +0 -102
- package/src/migrations/update-15-2-0/remove-browserlist-config.d.ts +0 -4
- package/src/migrations/update-15-2-0/remove-browserlist-config.js +0 -59
- package/src/migrations/update-15-2-0/remove-platform-server-exports.d.ts +0 -2
- package/src/migrations/update-15-2-0/remove-platform-server-exports.js +0 -62
- package/src/migrations/update-15-2-0/update-angular-cli.d.ts +0 -2
- package/src/migrations/update-15-2-0/update-angular-cli.js +0 -22
- package/src/migrations/update-15-2-0/update-karma-main-file.d.ts +0 -2
- package/src/migrations/update-15-2-0/update-karma-main-file.js +0 -72
- package/src/migrations/update-15-2-0/update-typescript-target.d.ts +0 -2
- package/src/migrations/update-15-2-0/update-typescript-target.js +0 -52
- package/src/migrations/update-15-2-0/update-workspace-config.d.ts +0 -2
- package/src/migrations/update-15-2-0/update-workspace-config.js +0 -24
- package/src/migrations/update-15-5-0/update-angular-cli.d.ts +0 -2
- package/src/migrations/update-15-5-0/update-angular-cli.js +0 -22
- package/src/migrations/update-15-7-0/install-required-packages.d.ts +0 -2
- package/src/migrations/update-15-7-0/install-required-packages.js +0 -36
- package/src/migrations/update-15-8-0/update-angular-cli.d.ts +0 -2
- package/src/migrations/update-15-8-0/update-angular-cli.js +0 -22
- package/src/migrations/update-15-9-0/update-file-server-executor.d.ts +0 -2
- package/src/migrations/update-15-9-0/update-file-server-executor.js +0 -42
- package/src/migrations/update-15-9-0/update-testing-tsconfig.d.ts +0 -3
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js +0 -32
- package/src/migrations/update-16-0-0/remove-karma-defaults.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-karma-defaults.js +0 -52
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +0 -40
- package/src/migrations/update-16-0-0/remove-protractor-defaults.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-protractor-defaults.js +0 -52
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.d.ts +0 -2
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +0 -127
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.d.ts +0 -2
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +0 -22
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.d.ts +0 -2
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +0 -62
- package/src/migrations/update-16-1-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-16-1-0/update-server-executor-config.d.ts +0 -2
- package/src/migrations/update-16-1-0/update-server-executor-config.js +0 -26
- package/src/runtime/nx/data-persistence.d.ts +0 -276
- package/src/utils/mf/utils.d.ts +0 -15
- package/src/utils/mf/utils.js +0 -101
- package/src/utils/mf/with-module-federation-ssr.d.ts +0 -2
- package/src/utils/mf/with-module-federation-ssr.js +0 -68
- package/src/utils/mf/with-module-federation.d.ts +0 -2
- package/src/utils/mf/with-module-federation.js +0 -70
- package/testing/index.d.ts +0 -1
- package/testing/ng-package.json +0 -6
- package/testing/src/testing-utils.d.ts +0 -33
- /package/src/executors/utilities/ng-packagr/{stylesheet-processor.d.ts → pre-v19/stylesheet-processor.d.ts} +0 -0
- /package/src/generators/setup-ssr/files/{ngmodule/src → pre-v19/ngmodule-src}/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{ngmodule/src → pre-v19/ngmodule-src}/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{root → pre-v19/root}/tsconfig.server.json__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{standalone/src → pre-v19/standalone-src}/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{standalone/src → pre-v19/standalone-src}/app/app.config.server.ts__tpl__ +0 -0
|
@@ -4,21 +4,23 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
6
6
|
const selector_1 = require("../../utils/selector");
|
|
7
|
+
const validations_1 = require("../../utils/validations");
|
|
7
8
|
async function normalizeOptions(tree, options) {
|
|
8
9
|
options.type ??= 'component';
|
|
9
10
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
10
|
-
artifactType: 'component',
|
|
11
|
-
callingGenerator: '@nx/angular:component',
|
|
12
11
|
name: options.name,
|
|
13
|
-
|
|
14
|
-
flat: options.flat,
|
|
15
|
-
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
16
|
-
project: options.project,
|
|
12
|
+
path: options.path,
|
|
17
13
|
suffix: options.type ?? 'component',
|
|
14
|
+
allowedFileExtensions: ['ts'],
|
|
15
|
+
fileExtension: 'ts',
|
|
18
16
|
});
|
|
17
|
+
if (name.includes('/')) {
|
|
18
|
+
throw new Error(`The component name '${name}' cannot contain a slash as it must be a valid JS symbol. Please use a different name.`);
|
|
19
|
+
}
|
|
19
20
|
const { className } = (0, devkit_1.names)(name);
|
|
20
21
|
const { className: suffixClassName } = (0, devkit_1.names)(options.type);
|
|
21
22
|
const symbolName = `${className}${suffixClassName}`;
|
|
23
|
+
(0, validations_1.validateClassName)(symbolName);
|
|
22
24
|
const { prefix, root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
23
25
|
const selector = options.selector ?? (0, selector_1.buildSelector)(name, options.prefix, prefix, 'fileName');
|
|
24
26
|
(0, selector_1.validateHtmlSelector)(selector);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
|
|
2
|
-
|
|
3
1
|
export interface Schema {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
nameAndDirectoryFormat?: NameAndDirectoryFormat;
|
|
2
|
+
path: string;
|
|
3
|
+
name?: string;
|
|
7
4
|
displayBlock?: boolean;
|
|
8
5
|
inlineStyle?: boolean;
|
|
9
6
|
inlineTemplate?: boolean;
|
|
@@ -18,21 +15,9 @@ export interface Schema {
|
|
|
18
15
|
module?: string;
|
|
19
16
|
skipSelector?: boolean;
|
|
20
17
|
export?: boolean;
|
|
18
|
+
exportDefault?: boolean;
|
|
21
19
|
prefix?: string;
|
|
22
20
|
skipFormat?: boolean;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
26
|
-
*/
|
|
27
|
-
flat?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
30
|
-
*/
|
|
31
|
-
path?: string;
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
34
|
-
*/
|
|
35
|
-
project?: string;
|
|
36
21
|
}
|
|
37
22
|
|
|
38
23
|
export interface NormalizedSchema extends Schema {
|
|
@@ -7,34 +7,18 @@
|
|
|
7
7
|
"description": "Creates a new Angular component.",
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
|
-
"
|
|
10
|
+
"path": {
|
|
11
11
|
"type": "string",
|
|
12
|
-
"description": "The
|
|
12
|
+
"description": "The file path to the component. Relative to the current working directory.",
|
|
13
13
|
"$default": {
|
|
14
14
|
"$source": "argv",
|
|
15
15
|
"index": 0
|
|
16
16
|
},
|
|
17
|
-
"x-prompt": "What
|
|
18
|
-
},
|
|
19
|
-
"directory": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The directory at which to create the component file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
|
22
|
-
"aliases": ["dir", "path"],
|
|
23
|
-
"x-priority": "important"
|
|
17
|
+
"x-prompt": "What is the component file path?"
|
|
24
18
|
},
|
|
25
|
-
"
|
|
26
|
-
"description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
|
|
19
|
+
"name": {
|
|
27
20
|
"type": "string",
|
|
28
|
-
"
|
|
29
|
-
},
|
|
30
|
-
"project": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"description": "The name of the project.",
|
|
33
|
-
"$default": {
|
|
34
|
-
"$source": "projectName"
|
|
35
|
-
},
|
|
36
|
-
"x-dropdown": "projects",
|
|
37
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
|
|
21
|
+
"description": "The component symbol name. Defaults to the last segment of the file path."
|
|
38
22
|
},
|
|
39
23
|
"prefix": {
|
|
40
24
|
"type": "string",
|
|
@@ -94,12 +78,6 @@
|
|
|
94
78
|
"description": "Do not create `spec.ts` test files for the new component.",
|
|
95
79
|
"default": false
|
|
96
80
|
},
|
|
97
|
-
"flat": {
|
|
98
|
-
"type": "boolean",
|
|
99
|
-
"description": "Create the new files at the top level of the current project.",
|
|
100
|
-
"default": false,
|
|
101
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
102
|
-
},
|
|
103
81
|
"skipImport": {
|
|
104
82
|
"type": "boolean",
|
|
105
83
|
"description": "Do not import this component into the owning NgModule.",
|
|
@@ -126,6 +104,11 @@
|
|
|
126
104
|
"default": false,
|
|
127
105
|
"x-priority": "important"
|
|
128
106
|
},
|
|
107
|
+
"exportDefault": {
|
|
108
|
+
"type": "boolean",
|
|
109
|
+
"default": false,
|
|
110
|
+
"description": "Use default export for the component instead of a named export."
|
|
111
|
+
},
|
|
129
112
|
"skipFormat": {
|
|
130
113
|
"description": "Skip formatting files.",
|
|
131
114
|
"type": "boolean",
|
|
@@ -133,6 +116,6 @@
|
|
|
133
116
|
"x-priority": "internal"
|
|
134
117
|
}
|
|
135
118
|
},
|
|
136
|
-
"required": ["
|
|
119
|
+
"required": ["path"],
|
|
137
120
|
"examplesFile": "../../../docs/component-examples.md"
|
|
138
121
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/angular';
|
|
2
2
|
import { <%=componentName%> } from './<%=componentFileName%>';
|
|
3
|
-
<% if ( interactionTests ) { %>
|
|
3
|
+
<%_ if ( interactionTests ) { _%>
|
|
4
4
|
import { within } from '@storybook/testing-library';
|
|
5
5
|
import { expect } from '@storybook/jest';
|
|
6
|
-
<% } %>
|
|
6
|
+
<%_ } _%>
|
|
7
7
|
|
|
8
8
|
const meta: Meta<<%= componentName %>> = {
|
|
9
9
|
component: <%= componentName %>,
|
|
@@ -18,7 +18,7 @@ export const Primary: Story = {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
<% if ( interactionTests ) { %>
|
|
21
|
+
<%_ if ( interactionTests ) { _%>
|
|
22
22
|
export const Heading: Story = {
|
|
23
23
|
args: {<% for (let prop of props) { %>
|
|
24
24
|
<%= prop.name %>: <%- prop.defaultValue %>,<% } %>
|
|
@@ -28,4 +28,4 @@ export const Heading: Story = {
|
|
|
28
28
|
expect(canvas.getByText(/<%=componentNameSimple%> works!/gi)).toBeTruthy();
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
|
-
<% } %>
|
|
31
|
+
<%_ } _%>
|
|
@@ -6,7 +6,7 @@ const versions_1 = require("../../utils/versions");
|
|
|
6
6
|
const storybook_inputs_1 = require("../utils/storybook-ast/storybook-inputs");
|
|
7
7
|
async function componentTestGenerator(tree, options) {
|
|
8
8
|
(0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
9
|
-
const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/
|
|
9
|
+
const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/versions');
|
|
10
10
|
assertMinimumCypressVersion(10);
|
|
11
11
|
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
12
12
|
const componentDirPath = (0, devkit_1.joinPathFragments)(root, options.componentDir);
|
|
@@ -26,10 +26,7 @@ const redundantExecutors = new Set([
|
|
|
26
26
|
'@nx/angular:webpack-server',
|
|
27
27
|
]);
|
|
28
28
|
async function convertToApplicationExecutor(tree, options) {
|
|
29
|
-
const {
|
|
30
|
-
if (angularMajorVersion < 17) {
|
|
31
|
-
throw new Error(`The "convert-to-application-executor" generator is only supported in Angular >= 17.0.0. You are currently using "${angularVersion}".`);
|
|
32
|
-
}
|
|
29
|
+
const { version: angularVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
33
30
|
let didAnySucceed = false;
|
|
34
31
|
if (options.project) {
|
|
35
32
|
(0, validations_1.validateProject)(tree, options.project);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxAngularConvertToApplicationExecutorGenerator",
|
|
4
4
|
"cli": "nx",
|
|
5
|
-
"title": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder.
|
|
5
|
+
"title": "Converts projects to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder.",
|
|
6
6
|
"description": "Converts a project or all projects using one of the `@angular-devkit/build-angular:browser`, `@angular-devkit/build-angular:browser-esbuild`, `@nx/angular:browser` and `@nx/angular:browser-esbuild` executors to use the `@nx/angular:application` executor or the `@angular-devkit/build-angular:application` builder. If the converted target is using one of the `@nx/angular` executors, the `@nx/angular:application` executor will be used. Otherwise, the `@angular-devkit/build-angular:application` builder will be used.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertToRspack = convertToRspack;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const versions_1 = require("../../utils/versions");
|
|
6
|
+
const create_config_1 = require("./lib/create-config");
|
|
7
|
+
const get_custom_webpack_config_1 = require("./lib/get-custom-webpack-config");
|
|
8
|
+
const update_tsconfig_1 = require("./lib/update-tsconfig");
|
|
9
|
+
const validate_supported_executor_1 = require("./lib/validate-supported-executor");
|
|
10
|
+
const posix_1 = require("path/posix");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
13
|
+
const enquirer_1 = require("enquirer");
|
|
14
|
+
const SUPPORTED_EXECUTORS = [
|
|
15
|
+
'@angular-devkit/build-angular:browser',
|
|
16
|
+
'@angular-devkit/build-angular:dev-server',
|
|
17
|
+
'@angular-devkit/build-angular:server',
|
|
18
|
+
'@angular-devkit/build-angular:prerender',
|
|
19
|
+
'@angular-devkit/build-angular:app-shell',
|
|
20
|
+
'@nx/angular:webpack-browser',
|
|
21
|
+
'@nx/angular:webpack-server',
|
|
22
|
+
'@nx/angular:dev-server',
|
|
23
|
+
'@nx/angular:module-federation-dev-server',
|
|
24
|
+
];
|
|
25
|
+
const RENAMED_OPTIONS = {
|
|
26
|
+
main: 'browser',
|
|
27
|
+
ngswConfigPath: 'serviceWorker',
|
|
28
|
+
};
|
|
29
|
+
const DEFAULT_PORT = 4200;
|
|
30
|
+
const REMOVED_OPTIONS = ['buildOptimizer', 'buildTarget', 'browserTarget'];
|
|
31
|
+
function normalizeFromProjectRoot(tree, path, projectRoot) {
|
|
32
|
+
if (projectRoot === '.') {
|
|
33
|
+
if (!path.startsWith('./')) {
|
|
34
|
+
return `./${path}`;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return path;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (path.startsWith(projectRoot)) {
|
|
41
|
+
return path.replace(projectRoot, '.');
|
|
42
|
+
}
|
|
43
|
+
else if (!path.startsWith('./')) {
|
|
44
|
+
if (tree.exists(path)) {
|
|
45
|
+
const pathWithWorkspaceRoot = (0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, path);
|
|
46
|
+
const projectRootWithWorkspaceRoot = (0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, projectRoot);
|
|
47
|
+
return (0, path_1.relative)(projectRootWithWorkspaceRoot, pathWithWorkspaceRoot);
|
|
48
|
+
}
|
|
49
|
+
return `./${path}`;
|
|
50
|
+
}
|
|
51
|
+
return path;
|
|
52
|
+
}
|
|
53
|
+
const defaultNormalizer = (tree, path, root) => normalizeFromProjectRoot(tree, path, root);
|
|
54
|
+
const PATH_NORMALIZER = {
|
|
55
|
+
index: (tree, path, root) => {
|
|
56
|
+
if (typeof path === 'string') {
|
|
57
|
+
return normalizeFromProjectRoot(tree, path, root);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
input: normalizeFromProjectRoot(tree, path.input, root),
|
|
61
|
+
output: path.output ?? 'index.html',
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
indexHtmlTransformer: defaultNormalizer,
|
|
65
|
+
main: defaultNormalizer,
|
|
66
|
+
server: defaultNormalizer,
|
|
67
|
+
tsConfig: defaultNormalizer,
|
|
68
|
+
outputPath: (tree, path, root) => {
|
|
69
|
+
const relativePathFromWorkspaceRoot = (0, path_1.relative)((0, devkit_1.joinPathFragments)(devkit_1.workspaceRoot, root), devkit_1.workspaceRoot);
|
|
70
|
+
return (0, devkit_1.joinPathFragments)(relativePathFromWorkspaceRoot, path);
|
|
71
|
+
},
|
|
72
|
+
proxyConfig: defaultNormalizer,
|
|
73
|
+
polyfills: (tree, paths, root) => {
|
|
74
|
+
const normalizedPaths = [];
|
|
75
|
+
const normalizeFn = (path) => {
|
|
76
|
+
if (path.startsWith('zone.js')) {
|
|
77
|
+
normalizedPaths.push(path);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const resolvedPath = require.resolve(path, {
|
|
82
|
+
paths: [(0, posix_1.join)(devkit_1.workspaceRoot, 'node_modules')],
|
|
83
|
+
});
|
|
84
|
+
normalizedPaths.push(path);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
normalizedPaths.push(normalizeFromProjectRoot(tree, path, root));
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
if (typeof paths === 'string') {
|
|
91
|
+
normalizeFn(paths);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
for (const path of paths) {
|
|
95
|
+
normalizeFn(path);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return normalizedPaths;
|
|
99
|
+
},
|
|
100
|
+
styles: (tree, paths, root) => {
|
|
101
|
+
const normalizedPaths = [];
|
|
102
|
+
for (const path of paths) {
|
|
103
|
+
if (typeof path === 'string') {
|
|
104
|
+
normalizedPaths.push(normalizeFromProjectRoot(tree, path, root));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
normalizedPaths.push({
|
|
108
|
+
input: normalizeFromProjectRoot(tree, path.input, root),
|
|
109
|
+
bundleName: path.bundleName,
|
|
110
|
+
inject: path.inject ?? true,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return normalizedPaths;
|
|
115
|
+
},
|
|
116
|
+
scripts: (tree, paths, root) => {
|
|
117
|
+
const normalizedPaths = [];
|
|
118
|
+
for (const path of paths) {
|
|
119
|
+
if (typeof path === 'string') {
|
|
120
|
+
normalizedPaths.push(normalizeFromProjectRoot(tree, path, root));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
normalizedPaths.push({
|
|
124
|
+
input: normalizeFromProjectRoot(tree, path.input, root),
|
|
125
|
+
bundleName: path.bundleName,
|
|
126
|
+
inject: path.inject ?? true,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return normalizedPaths;
|
|
131
|
+
},
|
|
132
|
+
assets: (tree, paths, root) => {
|
|
133
|
+
const normalizedPaths = [];
|
|
134
|
+
for (const path of paths) {
|
|
135
|
+
if (typeof path === 'string') {
|
|
136
|
+
normalizedPaths.push(normalizeFromProjectRoot(tree, path, root));
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
normalizedPaths.push({
|
|
140
|
+
...path,
|
|
141
|
+
input: normalizeFromProjectRoot(tree, path.input, root),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return normalizedPaths;
|
|
146
|
+
},
|
|
147
|
+
fileReplacements: (tree, paths, root) => {
|
|
148
|
+
const normalizedPaths = [];
|
|
149
|
+
for (const path of paths) {
|
|
150
|
+
normalizedPaths.push({
|
|
151
|
+
replace: normalizeFromProjectRoot(tree, 'src' in path ? path.src : path.replace, root),
|
|
152
|
+
with: normalizeFromProjectRoot(tree, 'replaceWith' in path ? path.replaceWith : path.with, root),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return normalizedPaths;
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
function handleBuildTargetOptions(tree, options, newConfigurationOptions, root) {
|
|
159
|
+
let customWebpackConfigPath;
|
|
160
|
+
if (!options || Object.keys(options).length === 0) {
|
|
161
|
+
return customWebpackConfigPath;
|
|
162
|
+
}
|
|
163
|
+
if (options.customWebpackConfig) {
|
|
164
|
+
customWebpackConfigPath = options.customWebpackConfig.path;
|
|
165
|
+
delete options.customWebpackConfig;
|
|
166
|
+
}
|
|
167
|
+
if (options.outputs) {
|
|
168
|
+
// handled by the Rspack inference plugin
|
|
169
|
+
delete options.outputs;
|
|
170
|
+
}
|
|
171
|
+
for (const [key, value] of Object.entries(options)) {
|
|
172
|
+
let optionName = key;
|
|
173
|
+
let optionValue = key in PATH_NORMALIZER ? PATH_NORMALIZER[key](tree, value, root) : value;
|
|
174
|
+
if (REMOVED_OPTIONS.includes(key)) {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (key in RENAMED_OPTIONS) {
|
|
178
|
+
optionName = RENAMED_OPTIONS[key];
|
|
179
|
+
}
|
|
180
|
+
newConfigurationOptions[optionName] = optionValue;
|
|
181
|
+
}
|
|
182
|
+
if (typeof newConfigurationOptions.polyfills === 'string') {
|
|
183
|
+
newConfigurationOptions.polyfills = [newConfigurationOptions.polyfills];
|
|
184
|
+
}
|
|
185
|
+
let outputPath = newConfigurationOptions.outputPath;
|
|
186
|
+
if (typeof outputPath === 'string') {
|
|
187
|
+
if (!/\/browser\/?$/.test(outputPath)) {
|
|
188
|
+
console.warn(`The output location of the browser build has been updated from "${outputPath}" to ` +
|
|
189
|
+
`"${(0, posix_1.join)(outputPath, 'browser')}". ` +
|
|
190
|
+
'You might need to adjust your deployment pipeline or, as an alternative, ' +
|
|
191
|
+
'set outputPath.browser to "" in order to maintain the previous functionality.');
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
outputPath = outputPath.replace(/\/browser\/?$/, '');
|
|
195
|
+
}
|
|
196
|
+
newConfigurationOptions['outputPath'] = {
|
|
197
|
+
base: outputPath,
|
|
198
|
+
};
|
|
199
|
+
if (typeof newConfigurationOptions.resourcesOutputPath === 'string') {
|
|
200
|
+
const media = newConfigurationOptions.resourcesOutputPath.replaceAll('/', '');
|
|
201
|
+
if (media && media !== 'media') {
|
|
202
|
+
newConfigurationOptions['outputPath'] = {
|
|
203
|
+
base: outputPath,
|
|
204
|
+
media,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return customWebpackConfigPath;
|
|
210
|
+
}
|
|
211
|
+
function handleDevServerTargetOptions(tree, options, newConfigurationOptions, root) {
|
|
212
|
+
for (const [key, value] of Object.entries(options)) {
|
|
213
|
+
let optionName = key;
|
|
214
|
+
let optionValue = key in PATH_NORMALIZER ? PATH_NORMALIZER[key](tree, value, root) : value;
|
|
215
|
+
if (REMOVED_OPTIONS.includes(key)) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
if (key in RENAMED_OPTIONS) {
|
|
219
|
+
optionName = RENAMED_OPTIONS[key];
|
|
220
|
+
}
|
|
221
|
+
newConfigurationOptions[optionName] = optionValue;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
async function getProjectToConvert(tree) {
|
|
225
|
+
const projects = new Set();
|
|
226
|
+
for (const executor of SUPPORTED_EXECUTORS) {
|
|
227
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, executor, (_, project) => {
|
|
228
|
+
projects.add(project);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
const { project } = await (0, enquirer_1.prompt)({
|
|
232
|
+
type: 'select',
|
|
233
|
+
name: 'project',
|
|
234
|
+
message: 'Which project would you like to convert to rspack?',
|
|
235
|
+
choices: Array.from(projects),
|
|
236
|
+
});
|
|
237
|
+
return project;
|
|
238
|
+
}
|
|
239
|
+
async function convertToRspack(tree, schema) {
|
|
240
|
+
let { project: projectName } = schema;
|
|
241
|
+
if (!projectName) {
|
|
242
|
+
projectName = await getProjectToConvert(tree);
|
|
243
|
+
}
|
|
244
|
+
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
245
|
+
const tasks = [];
|
|
246
|
+
const createConfigOptions = {
|
|
247
|
+
root: project.root,
|
|
248
|
+
};
|
|
249
|
+
const configurationOptions = {};
|
|
250
|
+
const buildTargetNames = [];
|
|
251
|
+
const serveTargetNames = [];
|
|
252
|
+
let customWebpackConfigPath;
|
|
253
|
+
(0, validate_supported_executor_1.validateSupportedBuildExecutor)(Object.values(project.targets));
|
|
254
|
+
let projectServePort = DEFAULT_PORT;
|
|
255
|
+
for (const [targetName, target] of Object.entries(project.targets)) {
|
|
256
|
+
if (target.executor === '@angular-devkit/build-angular:browser' ||
|
|
257
|
+
target.executor === '@nx/angular:webpack-browser') {
|
|
258
|
+
customWebpackConfigPath = handleBuildTargetOptions(tree, target.options, createConfigOptions, project.root);
|
|
259
|
+
if (target.configurations) {
|
|
260
|
+
for (const [configurationName, configuration] of Object.entries(target.configurations)) {
|
|
261
|
+
configurationOptions[configurationName] = {};
|
|
262
|
+
handleBuildTargetOptions(tree, configuration, configurationOptions[configurationName], project.root);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
buildTargetNames.push(targetName);
|
|
266
|
+
}
|
|
267
|
+
else if (target.executor === '@angular-devkit/build-angular:server' ||
|
|
268
|
+
target.executor === '@nx/angular:webpack-server') {
|
|
269
|
+
createConfigOptions.ssr ??= {};
|
|
270
|
+
createConfigOptions.ssr.entry ??= normalizeFromProjectRoot(tree, target.options.main, project.root);
|
|
271
|
+
createConfigOptions.server = './src/main.server.ts';
|
|
272
|
+
buildTargetNames.push(targetName);
|
|
273
|
+
}
|
|
274
|
+
else if (target.executor === '@angular-devkit/build-angular:dev-server' ||
|
|
275
|
+
target.executor === '@nx/angular:dev-server' ||
|
|
276
|
+
target.executor === '@nx/angular:module-federation-dev-server') {
|
|
277
|
+
createConfigOptions.devServer = {};
|
|
278
|
+
if (target.options) {
|
|
279
|
+
handleDevServerTargetOptions(tree, target.options, createConfigOptions.devServer, project.root);
|
|
280
|
+
if (target.options.port !== DEFAULT_PORT) {
|
|
281
|
+
projectServePort = target.options.port;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
if (target.configurations) {
|
|
285
|
+
for (const [configurationName, configuration] of Object.entries(target.configurations)) {
|
|
286
|
+
configurationOptions[configurationName] ??= {};
|
|
287
|
+
configurationOptions[configurationName].devServer ??= {};
|
|
288
|
+
handleDevServerTargetOptions(tree, configuration, configurationOptions[configurationName].devServer, project.root);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
serveTargetNames.push(targetName);
|
|
292
|
+
}
|
|
293
|
+
else if (target.executor === '@angular-devkit/build-angular:prerender') {
|
|
294
|
+
if (target.options) {
|
|
295
|
+
const prerenderOptions = {
|
|
296
|
+
routesFile: target.options.routesFile,
|
|
297
|
+
discoverRoutes: target.options.discoverRoutes ?? true,
|
|
298
|
+
routes: target.options.routes ?? [],
|
|
299
|
+
};
|
|
300
|
+
createConfigOptions.prerender = prerenderOptions;
|
|
301
|
+
if (target.configurations) {
|
|
302
|
+
for (const [configurationName, configuration] of Object.entries(target.configurations)) {
|
|
303
|
+
configurationOptions[configurationName] ??= {};
|
|
304
|
+
configurationOptions[configurationName].prerender ??= {
|
|
305
|
+
routesFile: configuration.routesFile,
|
|
306
|
+
discoverRoutes: configuration.discoverRoutes ?? true,
|
|
307
|
+
routes: configuration.routes ?? [],
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
buildTargetNames.push(targetName);
|
|
313
|
+
}
|
|
314
|
+
else if (target.executor === '@angular-devkit/build-angular:app-shell') {
|
|
315
|
+
createConfigOptions.appShell = true;
|
|
316
|
+
buildTargetNames.push(targetName);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const customWebpackConfigInfo = customWebpackConfigPath
|
|
320
|
+
? await (0, get_custom_webpack_config_1.getCustomWebpackConfig)(tree, project.root, customWebpackConfigPath)
|
|
321
|
+
: undefined;
|
|
322
|
+
(0, create_config_1.createConfig)(tree, createConfigOptions, configurationOptions, customWebpackConfigInfo?.normalizedPathToCustomWebpackConfig, customWebpackConfigInfo?.isWebpackConfigFunction);
|
|
323
|
+
(0, update_tsconfig_1.updateTsconfig)(tree, project.root);
|
|
324
|
+
for (const targetName of [...buildTargetNames, ...serveTargetNames]) {
|
|
325
|
+
delete project.targets[targetName];
|
|
326
|
+
}
|
|
327
|
+
if (projectServePort !== DEFAULT_PORT) {
|
|
328
|
+
project.targets.serve ??= {};
|
|
329
|
+
project.targets.serve.options ??= {};
|
|
330
|
+
project.targets.serve.options.port = projectServePort;
|
|
331
|
+
}
|
|
332
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
|
333
|
+
const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
|
|
334
|
+
await rspackInitGenerator(tree, {
|
|
335
|
+
addPlugin: true,
|
|
336
|
+
framework: 'angular',
|
|
337
|
+
});
|
|
338
|
+
// This is needed to prevent a circular execution of the build target
|
|
339
|
+
const rootPkgJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
340
|
+
if (rootPkgJson.scripts?.build === 'nx build') {
|
|
341
|
+
delete rootPkgJson.scripts.build;
|
|
342
|
+
(0, devkit_1.writeJson)(tree, 'package.json', rootPkgJson);
|
|
343
|
+
}
|
|
344
|
+
if (!schema.skipInstall) {
|
|
345
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
346
|
+
'@nx/angular-rspack': versions_1.angularRspackVersion,
|
|
347
|
+
'webpack-merge': versions_1.webpackMergeVersion,
|
|
348
|
+
'ts-node': versions_1.tsNodeVersion,
|
|
349
|
+
});
|
|
350
|
+
tasks.push(installTask);
|
|
351
|
+
}
|
|
352
|
+
if (!schema.skipFormat) {
|
|
353
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
354
|
+
}
|
|
355
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
356
|
+
}
|
|
357
|
+
exports.default = convertToRspack;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createConfig = createConfig;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function createConfig(tree, opts, configurationOptions = {}, existingWebpackConfigPath, isExistingWebpackConfigFunction) {
|
|
6
|
+
const { root, ...createConfigOptions } = opts;
|
|
7
|
+
const hasConfigurations = Object.keys(configurationOptions).length > 0;
|
|
8
|
+
const expandedConfigurationOptions = hasConfigurations
|
|
9
|
+
? Object.entries(configurationOptions)
|
|
10
|
+
.map(([configurationName, configurationOptions]) => {
|
|
11
|
+
return `
|
|
12
|
+
"${configurationName}": {
|
|
13
|
+
options: {
|
|
14
|
+
${JSON.stringify(configurationOptions, undefined, 2).slice(1, -1)}
|
|
15
|
+
}
|
|
16
|
+
}`;
|
|
17
|
+
})
|
|
18
|
+
.join(',\n')
|
|
19
|
+
: '';
|
|
20
|
+
const createConfigContents = `createConfig({
|
|
21
|
+
options: {
|
|
22
|
+
root: __dirname,
|
|
23
|
+
${JSON.stringify(createConfigOptions, undefined, 2).slice(1, -1)}
|
|
24
|
+
}
|
|
25
|
+
}${hasConfigurations ? `, {${expandedConfigurationOptions}}` : ''});`;
|
|
26
|
+
const configContents = `
|
|
27
|
+
import { createConfig }from '@nx/angular-rspack';
|
|
28
|
+
${existingWebpackConfigPath
|
|
29
|
+
? `import baseWebpackConfig from '${existingWebpackConfigPath}';
|
|
30
|
+
${isExistingWebpackConfigFunction
|
|
31
|
+
? ''
|
|
32
|
+
: `import webpackMerge from 'webpack-merge';`}`
|
|
33
|
+
: ''}
|
|
34
|
+
|
|
35
|
+
${existingWebpackConfigPath
|
|
36
|
+
? `export default async () => {
|
|
37
|
+
const baseConfig = await ${createConfigContents}
|
|
38
|
+
${isExistingWebpackConfigFunction
|
|
39
|
+
? `const oldConfig = await baseWebpackConfig;
|
|
40
|
+
const browserConfig = baseConfig[0];
|
|
41
|
+
return oldConfig(browserConfig);`
|
|
42
|
+
: 'return webpackMerge(baseConfig[0], baseWebpackConfig);'}};`
|
|
43
|
+
: `export default ${createConfigContents}`}`;
|
|
44
|
+
tree.write((0, devkit_1.joinPathFragments)(root, 'rspack.config.ts'), configContents);
|
|
45
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
export declare function getCustomWebpackConfig(tree: Tree, projectRoot: string, pathToCustomWebpackConfig: string): Promise<{
|
|
3
|
+
isWebpackConfigFunction: boolean;
|
|
4
|
+
normalizedPathToCustomWebpackConfig: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents: string): string;
|