@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
|
@@ -2,43 +2,51 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
3
|
"$id": "NxMFRemote",
|
|
4
4
|
"cli": "nx",
|
|
5
|
-
"title": "Nx Module Federation Remote App",
|
|
6
|
-
"description": "Create an Angular Remote Module Federation Application.",
|
|
5
|
+
"title": "Nx Module Federation Producer (Remote) App",
|
|
6
|
+
"description": "Create an Angular Producer (Remote) Module Federation Application.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"examples": [
|
|
9
9
|
{
|
|
10
10
|
"command": "nx g @nx/angular:remote appName --host=host --port=4201",
|
|
11
|
-
"description": "Create an Angular app with configuration in place for Module Federation. If host is provided, attach this remote app to host app's configuration."
|
|
11
|
+
"description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"command": "nx g @nx/angular:producer appName --consumer=host --port=4201",
|
|
15
|
+
"description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
|
|
12
16
|
}
|
|
13
17
|
],
|
|
14
18
|
"properties": {
|
|
15
|
-
"
|
|
19
|
+
"directory": {
|
|
20
|
+
"description": "The directory of the new application.",
|
|
16
21
|
"type": "string",
|
|
17
|
-
"description": "The name to give to the remote Angular app.",
|
|
18
22
|
"$default": {
|
|
19
23
|
"$source": "argv",
|
|
20
24
|
"index": 0
|
|
21
25
|
},
|
|
22
|
-
"
|
|
26
|
+
"x-prompt": "Which directory do you want to create the application in?"
|
|
27
|
+
},
|
|
28
|
+
"name": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "The name to give to the Producer (remote) Angular app.",
|
|
31
|
+
"pattern": "^[a-zA-Z_$][a-zA-Z_$0-9]*$",
|
|
32
|
+
"x-priority": "important"
|
|
23
33
|
},
|
|
24
34
|
"host": {
|
|
25
35
|
"type": "string",
|
|
26
|
-
"description": "The name of the host app to attach this remote app to.",
|
|
36
|
+
"description": "The name of the Consumer (host) app to attach this Producer (remote) app to.",
|
|
27
37
|
"x-dropdown": "projects",
|
|
28
|
-
"x-priority": "important"
|
|
38
|
+
"x-priority": "important",
|
|
39
|
+
"alias": "consumer"
|
|
29
40
|
},
|
|
30
41
|
"port": {
|
|
31
42
|
"type": "number",
|
|
32
43
|
"description": "The port on which this app should be served."
|
|
33
44
|
},
|
|
34
|
-
"
|
|
35
|
-
"description": "The directory of the new application.",
|
|
36
|
-
"type": "string"
|
|
37
|
-
},
|
|
38
|
-
"projectNameAndRootFormat": {
|
|
39
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
45
|
+
"bundler": {
|
|
40
46
|
"type": "string",
|
|
41
|
-
"
|
|
47
|
+
"description": "The bundler to use for the remote application.",
|
|
48
|
+
"default": "webpack",
|
|
49
|
+
"enum": ["webpack", "rspack"]
|
|
42
50
|
},
|
|
43
51
|
"style": {
|
|
44
52
|
"description": "The file extension to be used for style files.",
|
|
@@ -105,8 +113,9 @@
|
|
|
105
113
|
},
|
|
106
114
|
"unitTestRunner": {
|
|
107
115
|
"type": "string",
|
|
108
|
-
"enum": ["jest", "none"],
|
|
116
|
+
"enum": ["jest", "vitest", "none"],
|
|
109
117
|
"description": "Test runner to use for unit tests.",
|
|
118
|
+
"x-prompt": "Which unit test runner would you like to use?",
|
|
110
119
|
"default": "jest"
|
|
111
120
|
},
|
|
112
121
|
"e2eTestRunner": {
|
|
@@ -135,12 +144,6 @@
|
|
|
135
144
|
"description": "Create an application with stricter type checking and build optimization options.",
|
|
136
145
|
"default": true
|
|
137
146
|
},
|
|
138
|
-
"standaloneConfig": {
|
|
139
|
-
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
140
|
-
"type": "boolean",
|
|
141
|
-
"default": true,
|
|
142
|
-
"x-deprecated": "Nx only supports standaloneConfig"
|
|
143
|
-
},
|
|
144
147
|
"setParserOptionsProject": {
|
|
145
148
|
"type": "boolean",
|
|
146
149
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
@@ -158,15 +161,19 @@
|
|
|
158
161
|
"x-priority": "internal"
|
|
159
162
|
},
|
|
160
163
|
"standalone": {
|
|
161
|
-
"description": "Whether to generate a remote application with standalone components.",
|
|
164
|
+
"description": "Whether to generate a Producer (remote) application with standalone components.",
|
|
162
165
|
"type": "boolean",
|
|
163
166
|
"default": true
|
|
164
167
|
},
|
|
165
168
|
"ssr": {
|
|
166
|
-
"description": "Whether to configure SSR for the remote application to be consumed by a host application using SSR.",
|
|
169
|
+
"description": "Whether to configure SSR for the Producer (remote) application to be consumed by a Consumer (host) application using SSR.",
|
|
167
170
|
"type": "boolean",
|
|
168
171
|
"default": false
|
|
169
172
|
},
|
|
173
|
+
"serverRouting": {
|
|
174
|
+
"description": "Creates a server application using the Server Routing and App Engine APIs (Developer Preview). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
|
175
|
+
"type": "boolean"
|
|
176
|
+
},
|
|
170
177
|
"typescriptConfiguration": {
|
|
171
178
|
"type": "boolean",
|
|
172
179
|
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
|
|
@@ -174,5 +181,5 @@
|
|
|
174
181
|
}
|
|
175
182
|
},
|
|
176
183
|
"additionalProperties": false,
|
|
177
|
-
"required": ["
|
|
184
|
+
"required": ["directory"]
|
|
178
185
|
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
6
|
+
const validations_1 = require("../../utils/validations");
|
|
6
7
|
async function normalizeOptions(tree, options) {
|
|
7
8
|
options.type ??= 'component';
|
|
8
9
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
9
|
-
artifactType: options.type,
|
|
10
|
-
callingGenerator: '@nx/angular:scam',
|
|
11
10
|
name: options.name,
|
|
12
|
-
|
|
13
|
-
flat: options.flat,
|
|
14
|
-
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
15
|
-
project: options.project,
|
|
11
|
+
path: options.path,
|
|
16
12
|
suffix: options.type ?? 'component',
|
|
13
|
+
allowedFileExtensions: ['ts'],
|
|
14
|
+
fileExtension: 'ts',
|
|
17
15
|
});
|
|
18
16
|
const { className } = (0, devkit_1.names)(name);
|
|
19
17
|
const { className: suffixClassName } = (0, devkit_1.names)(options.type);
|
|
20
18
|
const symbolName = `${className}${suffixClassName}`;
|
|
19
|
+
(0, validations_1.validateClassName)(symbolName);
|
|
21
20
|
return {
|
|
22
21
|
...options,
|
|
23
22
|
export: options.export ?? true,
|
|
@@ -13,8 +13,6 @@ async function scamGenerator(tree, rawOptions) {
|
|
|
13
13
|
export: false,
|
|
14
14
|
standalone: false,
|
|
15
15
|
skipFormat: true,
|
|
16
|
-
// options are already normalize, use them as is
|
|
17
|
-
nameAndDirectoryFormat: 'as-provided',
|
|
18
16
|
});
|
|
19
17
|
(0, lib_1.convertComponentToScam)(tree, options);
|
|
20
18
|
(0, export_scam_1.exportScam)(tree, options);
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { 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,10 @@ export interface Schema {
|
|
|
18
15
|
skipSelector?: boolean;
|
|
19
16
|
export?: boolean;
|
|
20
17
|
skipFormat?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
23
|
-
*/
|
|
24
|
-
flat?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
27
|
-
*/
|
|
28
|
-
path?: string;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
31
|
-
*/
|
|
32
|
-
project?: string;
|
|
33
18
|
}
|
|
34
19
|
|
|
35
20
|
export interface NormalizedSchema extends Schema {
|
|
21
|
+
name: string;
|
|
36
22
|
directory: string;
|
|
37
23
|
projectName: string;
|
|
38
24
|
fileName: string;
|
|
@@ -6,41 +6,33 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"description": "Generate a component with the exported symbol matching the file name. It results in the component `FooComponent` at `mylib/src/lib/foo.component.ts`",
|
|
10
|
+
"command": "nx g @nx/angular:scam mylib/src/lib/foo.component.ts"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "Generate a component without providing the file extension. It results in the component `FooComponent` at `mylib/src/lib/foo.component.ts`",
|
|
14
|
+
"command": "nx g @nx/angular:scam mylib/src/lib/foo"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"description": "Generate a component with the exported symbol different from the file name. It results in the component `CustomComponent` at `mylib/src/lib/foo.component.ts`",
|
|
18
|
+
"command": "nx g @nx/angular:scam mylib/src/lib/foo --name=custom"
|
|
11
19
|
}
|
|
12
20
|
],
|
|
13
21
|
"description": "Creates a new Angular SCAM.",
|
|
14
22
|
"additionalProperties": false,
|
|
15
23
|
"properties": {
|
|
16
|
-
"
|
|
24
|
+
"path": {
|
|
17
25
|
"type": "string",
|
|
18
|
-
"description": "The
|
|
26
|
+
"description": "The file path to the SCAM. Relative to the current working directory.",
|
|
19
27
|
"$default": {
|
|
20
28
|
"$source": "argv",
|
|
21
29
|
"index": 0
|
|
22
30
|
},
|
|
23
|
-
"x-prompt": "What
|
|
24
|
-
},
|
|
25
|
-
"directory": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "The directory at which to create the SCAM files. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
|
28
|
-
"aliases": ["dir", "path"],
|
|
29
|
-
"x-priority": "important"
|
|
31
|
+
"x-prompt": "What is the SCAM file path?"
|
|
30
32
|
},
|
|
31
|
-
"
|
|
32
|
-
"description": "Whether to generate the SCAM 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`).",
|
|
33
|
-
"type": "string",
|
|
34
|
-
"enum": ["as-provided", "derived"]
|
|
35
|
-
},
|
|
36
|
-
"project": {
|
|
33
|
+
"name": {
|
|
37
34
|
"type": "string",
|
|
38
|
-
"description": "The name of the
|
|
39
|
-
"$default": {
|
|
40
|
-
"$source": "projectName"
|
|
41
|
-
},
|
|
42
|
-
"x-dropdown": "projects",
|
|
43
|
-
"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."
|
|
35
|
+
"description": "The component symbol name. Defaults to the last segment of the file path."
|
|
44
36
|
},
|
|
45
37
|
"displayBlock": {
|
|
46
38
|
"description": "Specifies if the style will contain `:host { display: block; }`.",
|
|
@@ -90,12 +82,6 @@
|
|
|
90
82
|
"default": true,
|
|
91
83
|
"x-priority": "important"
|
|
92
84
|
},
|
|
93
|
-
"flat": {
|
|
94
|
-
"type": "boolean",
|
|
95
|
-
"description": "Create the new files at the top level of the current project.",
|
|
96
|
-
"default": false,
|
|
97
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
98
|
-
},
|
|
99
85
|
"selector": {
|
|
100
86
|
"type": "string",
|
|
101
87
|
"format": "html-selector",
|
|
@@ -138,5 +124,5 @@
|
|
|
138
124
|
"x-priority": "internal"
|
|
139
125
|
}
|
|
140
126
|
},
|
|
141
|
-
"required": ["
|
|
127
|
+
"required": ["path"]
|
|
142
128
|
}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
6
|
+
const validations_1 = require("../../utils/validations");
|
|
6
7
|
async function normalizeOptions(tree, options) {
|
|
7
8
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
8
|
-
artifactType: 'directive',
|
|
9
|
-
callingGenerator: '@nx/angular:scam-directive',
|
|
10
9
|
name: options.name,
|
|
11
|
-
|
|
12
|
-
flat: options.flat,
|
|
13
|
-
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
14
|
-
project: options.project,
|
|
10
|
+
path: options.path,
|
|
15
11
|
suffix: 'directive',
|
|
12
|
+
allowedFileExtensions: ['ts'],
|
|
13
|
+
fileExtension: 'ts',
|
|
16
14
|
});
|
|
17
15
|
const { className } = (0, devkit_1.names)(name);
|
|
18
16
|
const { className: suffixClassName } = (0, devkit_1.names)('directive');
|
|
19
17
|
const symbolName = `${className}${suffixClassName}`;
|
|
18
|
+
(0, validations_1.validateClassName)(symbolName);
|
|
20
19
|
return {
|
|
21
20
|
...options,
|
|
22
21
|
export: options.export ?? true,
|
|
@@ -13,8 +13,6 @@ async function scamDirectiveGenerator(tree, rawOptions) {
|
|
|
13
13
|
export: false,
|
|
14
14
|
standalone: false,
|
|
15
15
|
skipFormat: true,
|
|
16
|
-
// options are already normalize, use them as is
|
|
17
|
-
nameAndDirectoryFormat: 'as-provided',
|
|
18
16
|
});
|
|
19
17
|
(0, lib_1.convertDirectiveToScam)(tree, options);
|
|
20
18
|
(0, export_scam_1.exportScam)(tree, options);
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import { 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
|
skipTests?: boolean;
|
|
8
5
|
inlineScam?: boolean;
|
|
9
6
|
prefix?: string;
|
|
10
7
|
selector?: string;
|
|
11
8
|
export?: boolean;
|
|
12
9
|
skipFormat?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
15
|
-
*/
|
|
16
|
-
flat?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
19
|
-
*/
|
|
20
|
-
path?: string;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
23
|
-
*/
|
|
24
|
-
project?: string;
|
|
25
10
|
}
|
|
26
11
|
|
|
27
12
|
export interface NormalizedSchema extends Schema {
|
|
13
|
+
name: string;
|
|
28
14
|
directory: string;
|
|
29
15
|
export: boolean;
|
|
30
16
|
fileName: string;
|
|
@@ -6,42 +6,33 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"description": "Generate a directive with the exported symbol matching the file name. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
|
|
10
|
+
"command": "nx g @nx/angular:scam-directive mylib/src/lib/foo.directive.ts"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "Generate a directive without providing the file extension. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
|
|
14
|
+
"command": "nx g @nx/angular:scam-directive mylib/src/lib/foo"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"description": "Generate a directive with the exported symbol different from the file name. It results in the directive `CustomDirective` at `mylib/src/lib/foo.directive.ts`",
|
|
18
|
+
"command": "nx g @nx/angular:scam-directive mylib/src/lib/foo --name=custom"
|
|
11
19
|
}
|
|
12
20
|
],
|
|
13
21
|
"description": "Creates a new, generic Angular directive definition in the given or default project.",
|
|
14
22
|
"additionalProperties": false,
|
|
15
23
|
"properties": {
|
|
16
|
-
"
|
|
24
|
+
"path": {
|
|
17
25
|
"type": "string",
|
|
18
|
-
"description": "The
|
|
26
|
+
"description": "The file path to the SCAM directive. Relative to the current working directory.",
|
|
19
27
|
"$default": {
|
|
20
28
|
"$source": "argv",
|
|
21
29
|
"index": 0
|
|
22
30
|
},
|
|
23
|
-
"x-prompt": "What
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
|
-
"directory": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"description": "The directory at which to create the SCAM Directive files. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
|
|
29
|
-
"aliases": ["dir", "path"],
|
|
30
|
-
"x-priority": "important"
|
|
31
|
+
"x-prompt": "What is the SCAM directive file path?"
|
|
31
32
|
},
|
|
32
|
-
"
|
|
33
|
-
"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`).",
|
|
34
|
-
"type": "string",
|
|
35
|
-
"enum": ["as-provided", "derived"]
|
|
36
|
-
},
|
|
37
|
-
"project": {
|
|
33
|
+
"name": {
|
|
38
34
|
"type": "string",
|
|
39
|
-
"description": "The name of the
|
|
40
|
-
"$default": {
|
|
41
|
-
"$source": "projectName"
|
|
42
|
-
},
|
|
43
|
-
"x-dropdown": "projects",
|
|
44
|
-
"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."
|
|
35
|
+
"description": "The directive symbol name. Defaults to the last segment of the file path."
|
|
45
36
|
},
|
|
46
37
|
"skipTests": {
|
|
47
38
|
"type": "boolean",
|
|
@@ -54,12 +45,6 @@
|
|
|
54
45
|
"default": true,
|
|
55
46
|
"x-priority": "important"
|
|
56
47
|
},
|
|
57
|
-
"flat": {
|
|
58
|
-
"type": "boolean",
|
|
59
|
-
"description": "Create the new files at the top level of the current project.",
|
|
60
|
-
"default": true,
|
|
61
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
62
|
-
},
|
|
63
48
|
"selector": {
|
|
64
49
|
"type": "string",
|
|
65
50
|
"format": "html-selector",
|
|
@@ -92,5 +77,5 @@
|
|
|
92
77
|
"x-priority": "internal"
|
|
93
78
|
}
|
|
94
79
|
},
|
|
95
|
-
"required": ["
|
|
80
|
+
"required": ["path"]
|
|
96
81
|
}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
6
|
+
const validations_1 = require("../../utils/validations");
|
|
6
7
|
async function normalizeOptions(tree, options) {
|
|
7
8
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
|
|
8
|
-
artifactType: 'pipe',
|
|
9
|
-
callingGenerator: '@nx/angular:scam-pipe',
|
|
10
9
|
name: options.name,
|
|
11
|
-
|
|
12
|
-
flat: options.flat,
|
|
13
|
-
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
14
|
-
project: options.project,
|
|
10
|
+
path: options.path,
|
|
15
11
|
suffix: 'pipe',
|
|
12
|
+
allowedFileExtensions: ['ts'],
|
|
13
|
+
fileExtension: 'ts',
|
|
16
14
|
});
|
|
17
15
|
const { className } = (0, devkit_1.names)(name);
|
|
18
16
|
const { className: suffixClassName } = (0, devkit_1.names)('pipe');
|
|
19
17
|
const symbolName = `${className}${suffixClassName}`;
|
|
18
|
+
(0, validations_1.validateClassName)(symbolName);
|
|
20
19
|
return {
|
|
21
20
|
...options,
|
|
22
21
|
export: options.export ?? true,
|
|
@@ -13,8 +13,6 @@ async function scamPipeGenerator(tree, rawOptions) {
|
|
|
13
13
|
export: false,
|
|
14
14
|
standalone: false,
|
|
15
15
|
skipFormat: true,
|
|
16
|
-
// options are already normalize, use them as is
|
|
17
|
-
nameAndDirectoryFormat: 'as-provided',
|
|
18
16
|
});
|
|
19
17
|
(0, lib_1.convertPipeToScam)(tree, options);
|
|
20
18
|
(0, export_scam_1.exportScam)(tree, options);
|
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import { 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
|
skipTests?: boolean;
|
|
8
5
|
inlineScam?: boolean;
|
|
9
6
|
export?: boolean;
|
|
10
7
|
skipFormat?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
13
|
-
*/
|
|
14
|
-
flat?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
|
|
17
|
-
*/
|
|
18
|
-
path?: string;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
21
|
-
*/
|
|
22
|
-
project?: string;
|
|
23
8
|
}
|
|
24
9
|
|
|
25
10
|
export interface NormalizedSchema extends Schema {
|
|
11
|
+
name: string;
|
|
26
12
|
directory: string;
|
|
27
13
|
export: boolean;
|
|
28
14
|
fileName: string;
|
|
@@ -6,42 +6,33 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"description": "Generate a pipe with the exported symbol matching the file name. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
|
|
10
|
+
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo.pipe.ts"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"description": "Generate a pipe without providing the file extension. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
|
|
14
|
+
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"description": "Generate a pipe with the exported symbol different from the file name. It results in the pipe `CustomPipe` at `mylib/src/lib/foo.pipe.ts`",
|
|
18
|
+
"command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo --name=custom"
|
|
11
19
|
}
|
|
12
20
|
],
|
|
13
21
|
"description": "Creates a new, generic Angular pipe definition in the given or default project.",
|
|
14
22
|
"additionalProperties": false,
|
|
15
23
|
"properties": {
|
|
16
|
-
"
|
|
24
|
+
"path": {
|
|
17
25
|
"type": "string",
|
|
18
|
-
"description": "The
|
|
26
|
+
"description": "The file path to the SCAM pipe. Relative to the current working directory.",
|
|
19
27
|
"$default": {
|
|
20
28
|
"$source": "argv",
|
|
21
29
|
"index": 0
|
|
22
30
|
},
|
|
23
|
-
"x-prompt": "What
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
|
-
"directory": {
|
|
27
|
-
"type": "string",
|
|
28
|
-
"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.",
|
|
29
|
-
"aliases": ["dir", "path"],
|
|
30
|
-
"x-priority": "important"
|
|
31
|
+
"x-prompt": "What is the SCAM pipe file path?"
|
|
31
32
|
},
|
|
32
|
-
"
|
|
33
|
-
"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`).",
|
|
34
|
-
"type": "string",
|
|
35
|
-
"enum": ["as-provided", "derived"]
|
|
36
|
-
},
|
|
37
|
-
"project": {
|
|
33
|
+
"name": {
|
|
38
34
|
"type": "string",
|
|
39
|
-
"description": "The name of the
|
|
40
|
-
"$default": {
|
|
41
|
-
"$source": "projectName"
|
|
42
|
-
},
|
|
43
|
-
"x-dropdown": "projects",
|
|
44
|
-
"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."
|
|
35
|
+
"description": "The pipe symbol name. Defaults to the last segment of the file path."
|
|
45
36
|
},
|
|
46
37
|
"skipTests": {
|
|
47
38
|
"type": "boolean",
|
|
@@ -54,12 +45,6 @@
|
|
|
54
45
|
"default": true,
|
|
55
46
|
"x-priority": "important"
|
|
56
47
|
},
|
|
57
|
-
"flat": {
|
|
58
|
-
"type": "boolean",
|
|
59
|
-
"description": "Create the new files at the top level of the current project.",
|
|
60
|
-
"default": true,
|
|
61
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
62
|
-
},
|
|
63
48
|
"export": {
|
|
64
49
|
"type": "boolean",
|
|
65
50
|
"description": "Specifies if the SCAM should be exported from the project's entry point (normally `index.ts`). It only applies to libraries.",
|
|
@@ -73,5 +58,5 @@
|
|
|
73
58
|
"x-priority": "internal"
|
|
74
59
|
}
|
|
75
60
|
},
|
|
76
|
-
"required": ["
|
|
61
|
+
"required": ["path"]
|
|
77
62
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
1
2
|
import type { Node, SourceFile } from 'typescript';
|
|
2
|
-
import { Tree } from 'nx/src/generators/tree';
|
|
3
3
|
export declare function convertScamToStandalone(componentAST: SourceFile, componentFileContents: string, importsArray: string[], providersArray: string[], moduleNodes: Array<Node>, tree: Tree, normalizedComponentPath: string, componentName: string): void;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertScamToStandalone = convertScamToStandalone;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
5
|
const path_1 = require("path");
|
|
5
|
-
const
|
|
6
|
+
const version_utils_1 = require("../../utils/version-utils");
|
|
6
7
|
function convertScamToStandalone(componentAST, componentFileContents, importsArray, providersArray, moduleNodes, tree, normalizedComponentPath, componentName) {
|
|
7
8
|
let newComponentContents = '';
|
|
8
9
|
const COMPONENT_PROPERTY_SELECTOR = 'ClassDeclaration > Decorator > CallExpression:has(Identifier[name=Component]) ObjectLiteralExpression';
|
|
9
10
|
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
10
11
|
const componentDecoratorMetadataNode = tsquery(componentAST, COMPONENT_PROPERTY_SELECTOR, { visitAllChildren: true })[0];
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
13
|
+
newComponentContents = `${componentFileContents.slice(0, componentDecoratorMetadataNode.getStart() - 1)}({${angularMajorVersion < 19 ? `\nstandalone: true,` : ''}
|
|
13
14
|
imports: [${importsArray.join(',')}],${providersArray.length > 0 ? `providers: [${providersArray.join(',')}],` : ''}${componentFileContents.slice(componentDecoratorMetadataNode.getStart() + 1, moduleNodes[0].getStart() - 1)}`;
|
|
14
15
|
tree.write(normalizedComponentPath, newComponentContents);
|
|
15
16
|
const componentPathParts = (0, path_1.parse)(normalizedComponentPath);
|
|
16
|
-
const pathToComponentSpec = (0,
|
|
17
|
+
const pathToComponentSpec = (0, devkit_1.joinPathFragments)(componentPathParts.dir, '/', `${componentPathParts.name}.spec.ts`);
|
|
17
18
|
if (tree.exists(pathToComponentSpec)) {
|
|
18
19
|
const componentSpecContents = tree.read(pathToComponentSpec, 'utf-8');
|
|
19
20
|
// Only support testbed based tests
|
|
@@ -10,7 +10,9 @@ function replaceModuleUsagesWithComponent(tree, moduleName, componentName) {
|
|
|
10
10
|
}
|
|
11
11
|
const fileContents = tree.read(path, 'utf-8');
|
|
12
12
|
if (fileContents.includes(moduleName)) {
|
|
13
|
-
|
|
13
|
+
// Word boundary \b ensures that other modules won't be affected.
|
|
14
|
+
// E.g. "MapIconModule" would not be affected when "IconModule" is being migrated.
|
|
15
|
+
const moduleNameRegex = new RegExp(`\\b${moduleName}\\b`, 'g');
|
|
14
16
|
const newFileContents = fileContents.replace(moduleNameRegex, componentName);
|
|
15
17
|
tree.write(path, newFileContents);
|
|
16
18
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
@Component({<% if (prefix) { %>
|
|
4
|
-
selector: '<%= prefix %>-<%= appName %>-entry'
|
|
4
|
+
selector: '<%= prefix %>-<%= appName %>-entry',<% if (setStandaloneFalse) { %>
|
|
5
|
+
standalone: false,<% } %>
|
|
5
6
|
template: `<<%= prefix %>-nx-welcome></<%= prefix %>-nx-welcome>`<% } else { %>
|
|
6
7
|
selector: '<%= appName %>-entry',
|
|
7
8
|
template: `<nx-welcome></nx-welcome>`<% } %>
|
package/src/generators/setup-mf/files/standalone-entry-component-files/entry.component.ts__tmpl__
CHANGED
|
@@ -2,8 +2,8 @@ import { Component } from '@angular/core';
|
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
3
|
import { NxWelcomeComponent } from './nx-welcome.component';
|
|
4
4
|
|
|
5
|
-
@Component({
|
|
6
|
-
standalone: true
|
|
5
|
+
@Component({<% if (setStandaloneTrue) { %>
|
|
6
|
+
standalone: true,<% } %>
|
|
7
7
|
imports: [CommonModule, NxWelcomeComponent],<% if (prefix) { %>
|
|
8
8
|
selector: '<%= prefix %>-<%= appName %>-entry',
|
|
9
9
|
template: `<<%= prefix %>-nx-welcome></<%= prefix %>-nx-welcome>`<% } else { %>
|