@nx/angular 17.0.4 → 17.0.6
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 +4 -9
- package/esm2022/mf/mf.mjs +1 -1
- package/esm2022/src/runtime/nx/data-persistence.mjs +1 -1
- package/executors.d.ts +2 -9
- package/executors.js +2 -7
- package/executors.json +9 -19
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.d.ts +1 -1
- package/generators.js +1 -3
- package/generators.json +2 -7
- package/migrations.json +0 -451
- package/ng-package.json +2 -2
- package/package.json +26 -20
- package/plugins/component-testing.d.ts +26 -1
- package/plugins/component-testing.js +4 -15
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +5 -0
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +137 -0
- package/src/{executors → builders}/module-federation-dev-server/schema.d.ts +7 -25
- package/src/{executors → builders}/module-federation-dev-server/schema.json +6 -31
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +1 -1
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +9 -15
- package/src/builders/utilities/module-federation.js +1 -1
- package/src/builders/webpack-browser/schema.d.ts +2 -6
- package/src/builders/webpack-browser/schema.json +15 -15
- package/src/builders/webpack-browser/validate-options.d.ts +2 -0
- package/src/builders/webpack-browser/validate-options.js +40 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +6 -8
- package/src/builders/{dev-server → webpack-dev-server}/lib/index.d.ts +0 -1
- package/src/builders/{dev-server → webpack-dev-server}/lib/index.js +0 -1
- package/src/builders/webpack-dev-server/lib/normalize-options.d.ts +2 -0
- package/src/builders/webpack-dev-server/lib/normalize-options.js +14 -0
- package/src/builders/webpack-dev-server/schema.d.ts +21 -0
- package/src/builders/{dev-server → webpack-dev-server}/schema.json +5 -42
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.d.ts +4 -0
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +105 -0
- package/src/builders/webpack-server/schema.d.ts +1 -0
- package/src/builders/webpack-server/schema.json +20 -7
- package/src/builders/webpack-server/validate-options.js +7 -0
- package/src/builders/webpack-server/webpack-server.impl.js +9 -4
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +3 -2
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +8 -15
- package/src/executors/browser-esbuild/lib/buildable-libs.d.ts +9 -0
- package/src/executors/{utilities → browser-esbuild/lib}/buildable-libs.js +4 -3
- package/src/executors/browser-esbuild/lib/validate-options.d.ts +2 -0
- package/src/executors/browser-esbuild/lib/validate-options.js +40 -0
- package/src/executors/browser-esbuild/schema.d.ts +1 -3
- package/src/executors/browser-esbuild/schema.json +8 -38
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.transform.js +4 -6
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.transform.js +13 -25
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ngc → ngc}/compile-source-files.d.ts +2 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ngc → ngc}/compile-source-files.js +9 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.d.ts +10 -5
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.js +86 -39
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.d.ts +16 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.js +175 -0
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +17 -5
- package/src/executors/ng-packagr-lite/schema.json +1 -1
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +3 -5
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +1 -1
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +6 -13
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +10 -5
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +86 -39
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.d.ts +15 -0
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.js +197 -0
- package/src/executors/package/package.impl.d.ts +1 -1
- package/src/executors/package/package.impl.js +15 -5
- package/src/executors/package/schema.json +3 -3
- package/src/executors/utilities/tailwindcss.d.ts +7 -0
- package/src/executors/utilities/{ng-packagr/tailwindcss.js → tailwindcss.js} +22 -5
- package/src/executors/utilities/typescript.js +1 -1
- package/src/generators/add-linting/add-linting.d.ts +1 -1
- package/src/generators/add-linting/add-linting.js +15 -9
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts +2 -2
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +5 -9
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
- package/src/generators/add-linting/schema.json +1 -1
- package/src/generators/application/application.js +17 -19
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +1 -1
- package/src/generators/application/files/base/tsconfig.json__tpl__ +2 -6
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +1 -3
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +2 -4
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +1 -1
- package/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +14 -53
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +8 -2
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +4 -6
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +2 -4
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +14 -53
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +8 -4
- package/src/generators/application/files/tsconfig.editor.json__tpl__ +5 -0
- package/src/generators/application/files/v14/.browserlistrc__tpl__ +16 -0
- package/src/generators/application/files/v14/src/environments/environment.prod.ts__tpl__ +3 -0
- package/src/generators/application/files/v14/src/environments/environment.ts__tpl__ +16 -0
- package/src/generators/application/files/v14/src/polyfills.ts__tpl__ +53 -0
- package/src/generators/application/lib/add-e2e.js +8 -22
- package/src/generators/application/lib/add-unit-test-runner.js +20 -5
- package/src/generators/application/lib/create-files.js +10 -14
- package/src/generators/application/lib/create-project.d.ts +1 -1
- package/src/generators/application/lib/create-project.js +38 -48
- package/src/generators/application/lib/index.d.ts +0 -1
- package/src/generators/application/lib/index.js +0 -1
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +6 -28
- package/src/generators/application/lib/normalized-schema.d.ts +0 -5
- package/src/generators/application/lib/update-editor-tsconfig.d.ts +1 -1
- package/src/generators/application/lib/update-editor-tsconfig.js +14 -11
- package/src/generators/application/schema.d.ts +0 -1
- package/src/generators/application/schema.json +10 -18
- package/src/generators/component/component.js +1 -4
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +3 -2
- package/src/generators/component/files/__fileName__.ts__tpl__ +2 -8
- package/src/generators/component/lib/component.js +1 -1
- package/src/generators/component/lib/index.d.ts +1 -1
- package/src/generators/component/lib/index.js +1 -1
- package/src/generators/component/lib/normalize-options.js +2 -3
- package/src/generators/{setup-mf/lib/update-tsconfig.d.ts → component/lib/validate-options.d.ts} +1 -1
- package/src/generators/component/lib/validate-options.js +8 -0
- package/src/generators/component/schema.d.ts +3 -3
- package/src/generators/component/schema.json +4 -4
- package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +8 -13
- package/src/generators/component-cypress-spec/schema.json +1 -1
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +2 -2
- package/src/generators/component-test/component-test.d.ts +1 -1
- package/src/generators/component-test/component-test.js +3 -8
- package/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ +11 -9
- package/src/generators/component-test/schema.json +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +1 -3
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +2 -3
- package/src/generators/convert-to-with-mf/schema.d.ts +0 -1
- package/src/generators/convert-to-with-mf/schema.json +0 -6
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +24 -43
- package/src/generators/directive/directive.js +1 -0
- package/src/generators/directive/files/__fileName__.ts__tpl__ +3 -1
- package/src/generators/directive/lib/index.d.ts +1 -0
- package/src/generators/directive/lib/index.js +1 -0
- package/src/generators/directive/lib/normalize-options.js +1 -3
- package/src/generators/directive/lib/validate-options.d.ts +3 -0
- package/src/generators/directive/lib/validate-options.js +8 -0
- package/src/generators/directive/schema.d.ts +3 -3
- package/src/generators/directive/schema.json +4 -4
- package/src/generators/federate-module/federate-module.js +0 -1
- package/src/generators/federate-module/lib/add-remote.d.ts +1 -1
- package/src/generators/federate-module/lib/add-remote.js +11 -2
- package/src/generators/federate-module/schema.json +3 -3
- package/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/host/host.js +9 -8
- package/src/generators/host/lib/add-ssr.d.ts +3 -0
- package/src/generators/host/lib/{update-ssr-setup.js → add-ssr.js} +14 -8
- package/src/generators/host/lib/index.d.ts +1 -1
- package/src/generators/host/lib/index.js +1 -1
- package/src/generators/host/schema.json +6 -6
- package/src/generators/init/init.d.ts +2 -2
- package/src/generators/init/init.js +137 -19
- package/src/generators/init/schema.d.ts +9 -1
- package/src/generators/init/schema.json +59 -8
- package/src/generators/library/files/ng-module/src/lib/lib.routes.ts__tpl__ +1 -1
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +1 -1
- package/src/generators/library/lib/add-load-children.js +2 -2
- package/src/generators/library/lib/add-project.js +22 -24
- package/src/generators/library/lib/add-standalone-component.d.ts +2 -2
- package/src/generators/library/lib/add-standalone-component.js +4 -5
- package/src/generators/library/lib/normalize-options.js +5 -2
- package/src/generators/library/lib/update-tsconfig.js +3 -3
- package/src/generators/library/library.js +27 -15
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +13 -13
- package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +5 -1
- package/src/generators/library-secondary-entry-point/lib/index.d.ts +1 -0
- package/src/generators/library-secondary-entry-point/lib/index.js +1 -0
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.d.ts +3 -0
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +15 -0
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +2 -3
- package/src/generators/library-secondary-entry-point/schema.d.ts +0 -1
- package/src/generators/library-secondary-entry-point/schema.json +3 -9
- package/src/generators/move/schema.json +1 -1
- package/src/generators/ng-add/migrate-from-angular-cli.js +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +7 -50
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +23 -31
- package/src/generators/ng-add/ng-add.js +8 -1
- package/src/generators/ng-add/schema.json +1 -1
- package/src/generators/ng-add/utilities/workspace.d.ts +1 -1
- package/src/generators/ng-add/utilities/workspace.js +16 -9
- package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.models.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.selectors.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +22 -0
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +27 -0
- package/src/generators/ngrx/lib/generate-files.js +10 -1
- package/src/generators/ngrx/lib/validate-options.js +23 -0
- package/src/generators/ngrx/schema.json +3 -3
- package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.models.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.selectors.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +22 -0
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +27 -0
- package/src/generators/ngrx-feature-store/lib/generate-files.js +12 -1
- package/src/generators/ngrx-feature-store/lib/validate-options.js +22 -0
- package/src/generators/ngrx-feature-store/schema.json +3 -3
- package/src/generators/ngrx-root-store/lib/normalize-options.js +1 -1
- package/src/generators/ngrx-root-store/lib/validate-options.js +15 -0
- package/src/generators/ngrx-root-store/schema.json +2 -2
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +2 -0
- package/src/generators/pipe/lib/index.d.ts +1 -0
- package/src/generators/pipe/lib/index.js +1 -0
- package/src/generators/pipe/lib/normalize-options.js +0 -1
- package/src/generators/pipe/lib/validate-options.d.ts +3 -0
- package/src/generators/pipe/lib/validate-options.js +8 -0
- package/src/generators/pipe/pipe.js +1 -0
- package/src/generators/pipe/schema.d.ts +3 -3
- package/src/generators/pipe/schema.json +4 -4
- package/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/remote/files/common/{pre-v17/src → src}/main.server.ts__tmpl__ +3 -1
- package/src/generators/remote/lib/{update-ssr-setup.d.ts → add-ssr.d.ts} +1 -1
- package/src/generators/remote/lib/{update-ssr-setup.js → add-ssr.js} +13 -9
- package/src/generators/remote/lib/index.d.ts +1 -1
- package/src/generators/remote/lib/index.js +1 -1
- package/src/generators/remote/remote.js +9 -7
- package/src/generators/remote/schema.json +6 -6
- package/src/generators/scam/lib/convert-component-to-scam.js +1 -2
- package/src/generators/scam/schema.d.ts +3 -3
- package/src/generators/scam/schema.json +2 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +1 -2
- package/src/generators/scam-directive/scam-directive.js +1 -3
- package/src/generators/scam-directive/schema.d.ts +3 -4
- package/src/generators/scam-directive/schema.json +2 -8
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +1 -2
- package/src/generators/scam-pipe/scam-pipe.js +1 -3
- package/src/generators/scam-pipe/schema.d.ts +3 -4
- package/src/generators/scam-pipe/schema.json +2 -8
- package/src/generators/scam-to-standalone/scam-to-standalone.js +7 -0
- package/src/generators/scam-to-standalone/schema.json +2 -2
- package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +1 -3
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -12
- 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__ +12 -12
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -13
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +4 -14
- package/src/generators/setup-mf/lib/add-remote-entry.js +11 -2
- package/src/generators/setup-mf/lib/add-remote-to-host.js +1 -1
- package/src/generators/setup-mf/lib/fix-bootstrap.js +18 -10
- package/src/generators/setup-mf/lib/generate-config.js +0 -3
- package/src/generators/setup-mf/lib/index.d.ts +1 -1
- package/src/generators/setup-mf/lib/index.js +1 -1
- package/src/generators/setup-mf/lib/normalize-options.js +1 -2
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +10 -10
- package/src/generators/setup-mf/lib/set-tsconfig-target.d.ts +3 -0
- package/src/generators/setup-mf/lib/set-tsconfig-target.js +16 -0
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.js +2 -2
- package/src/generators/setup-mf/schema.d.ts +0 -1
- package/src/generators/setup-mf/schema.json +3 -8
- package/src/generators/setup-mf/setup-mf.js +7 -1
- package/src/generators/setup-ssr/files/{server/server-builder/pre-v17 → ngmodule/base}/__serverFileName__ +8 -7
- package/src/generators/setup-ssr/files/ngmodule/base/src/__main__ +1 -1
- package/src/generators/setup-ssr/files/ngmodule/v14/src/__main__ +11 -0
- package/src/generators/setup-ssr/files/{server/server-builder/v17+ → standalone}/__serverFileName__ +16 -25
- package/src/generators/setup-ssr/lib/add-hydration.js +5 -11
- package/src/generators/setup-ssr/lib/generate-files.d.ts +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +16 -11
- package/src/generators/setup-ssr/lib/index.d.ts +0 -4
- package/src/generators/setup-ssr/lib/index.js +0 -4
- package/src/generators/setup-ssr/lib/normalize-options.js +1 -7
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +1 -2
- package/src/generators/setup-ssr/lib/update-project-config.js +13 -46
- package/src/generators/setup-ssr/lib/validate-options.js +2 -15
- package/src/generators/setup-ssr/schema.json +4 -4
- package/src/generators/setup-ssr/setup-ssr.js +12 -18
- package/src/generators/setup-tailwind/schema.json +1 -1
- package/src/generators/stories/schema.json +1 -1
- package/src/generators/stories/stories.js +2 -2
- package/src/generators/storybook-configuration/lib/generate-stories.js +4 -6
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +1 -3
- package/src/generators/storybook-configuration/schema.d.ts +1 -1
- package/src/generators/storybook-configuration/schema.json +7 -7
- package/src/generators/storybook-configuration/storybook-configuration.js +5 -8
- package/src/generators/utils/create-ts-config.d.ts +8 -0
- package/src/generators/utils/create-ts-config.js +35 -0
- package/src/generators/utils/dependencies.js +2 -1
- package/src/generators/utils/export-scam.js +2 -2
- package/src/generators/utils/project.d.ts +1 -0
- package/src/generators/utils/project.js +29 -2
- package/src/generators/utils/selector.d.ts +2 -2
- package/src/generators/utils/selector.js +4 -11
- package/src/generators/utils/testing.js +1 -24
- package/src/generators/utils/validations.d.ts +1 -0
- package/src/generators/utils/validations.js +14 -1
- package/src/generators/utils/version-utils.d.ts +2 -2
- package/src/generators/utils/version-utils.js +3 -3
- package/src/utils/backward-compatible-versions.d.ts +4 -6
- package/src/utils/backward-compatible-versions.js +22 -20
- package/src/utils/mf/utils.js +0 -7
- package/src/utils/mf/with-module-federation-ssr.js +0 -3
- package/src/utils/mf/with-module-federation.js +0 -3
- package/src/utils/nx-devkit/ast-utils.js +2 -4
- package/src/utils/nx-devkit/testing.js +31 -27
- package/src/utils/{index.d.ts → public-api.d.ts} +0 -5
- package/src/utils/{index.js → public-api.js} +0 -5
- package/src/utils/version-utils.d.ts +3 -3
- package/src/utils/versions.d.ts +11 -9
- package/src/utils/versions.js +12 -10
- package/src/builders/dev-server/dev-server.impl.d.ts +0 -4
- package/src/builders/dev-server/dev-server.impl.js +0 -160
- package/src/builders/dev-server/lib/normalize-options.d.ts +0 -2
- package/src/builders/dev-server/lib/normalize-options.js +0 -20
- package/src/builders/dev-server/lib/validate-options.d.ts +0 -2
- package/src/builders/dev-server/lib/validate-options.js +0 -22
- package/src/builders/dev-server/schema.d.ts +0 -39
- package/src/executors/application/application.impl.d.ts +0 -3
- package/src/executors/application/application.impl.js +0 -37
- package/src/executors/application/schema.d.ts +0 -8
- package/src/executors/application/schema.json +0 -682
- package/src/executors/application/utils/validate-options.d.ts +0 -2
- package/src/executors/application/utils/validate-options.js +0 -52
- package/src/executors/extract-i18n/extract-i18n.impl.d.ts +0 -3
- package/src/executors/extract-i18n/extract-i18n.impl.js +0 -43
- package/src/executors/extract-i18n/schema.d.ts +0 -8
- package/src/executors/extract-i18n/schema.json +0 -45
- 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 -56
- package/src/executors/module-federation-dev-server/lib/index.d.ts +0 -5
- package/src/executors/module-federation-dev-server/lib/index.js +0 -8
- package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -23
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.d.ts +0 -11
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.js +0 -18
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -9
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
- 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 -46
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -115
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +0 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +0 -34
- 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.d.ts +0 -8
- 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 -285
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +0 -3
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +0 -28
- package/src/executors/utilities/buildable-libs.d.ts +0 -6
- package/src/executors/utilities/esbuild-extensions.d.ts +0 -10
- package/src/executors/utilities/esbuild-extensions.js +0 -50
- package/src/executors/utilities/module-loader.d.ts +0 -15
- package/src/executors/utilities/module-loader.js +0 -52
- package/src/executors/utilities/ng-compiler-cli.d.ts +0 -1
- package/src/executors/utilities/ng-compiler-cli.js +0 -8
- package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts +0 -49
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts +0 -2
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +0 -16
- package/src/executors/utilities/ng-packagr/stylesheet-processor.js +0 -209
- package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +0 -7
- package/src/executors/utilities/patch-builder-context.d.ts +0 -3
- package/src/executors/utilities/patch-builder-context.js +0 -41
- package/src/generators/add-linting/lib/buildable-project.d.ts +0 -2
- package/src/generators/add-linting/lib/buildable-project.js +0 -9
- package/src/generators/application/lib/set-generator-defaults.d.ts +0 -3
- package/src/generators/application/lib/set-generator-defaults.js +0 -17
- package/src/generators/component/lib/set-generator-defaults.d.ts +0 -3
- package/src/generators/component/lib/set-generator-defaults.js +0 -14
- package/src/generators/convert-to-application-executor/convert-to-application-executor.d.ts +0 -4
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +0 -242
- package/src/generators/convert-to-application-executor/schema.d.ts +0 -4
- package/src/generators/convert-to-application-executor/schema.json +0 -26
- package/src/generators/host/files/common/v17+/src/main.server.ts__tmpl__ +0 -67
- package/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
- package/src/generators/library/lib/set-generator-defaults.d.ts +0 -3
- package/src/generators/library/lib/set-generator-defaults.js +0 -15
- package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +0 -73
- package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
- package/src/generators/setup-mf/lib/update-tsconfig.js +0 -19
- package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +0 -56
- package/src/generators/setup-ssr/lib/add-dependencies.d.ts +0 -2
- package/src/generators/setup-ssr/lib/add-dependencies.js +0 -36
- package/src/generators/setup-ssr/lib/add-server-file.d.ts +0 -3
- package/src/generators/setup-ssr/lib/add-server-file.js +0 -31
- package/src/generators/setup-ssr/lib/constants.d.ts +0 -3
- package/src/generators/setup-ssr/lib/constants.js +0 -6
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +0 -4
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +0 -29
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +0 -3
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +0 -93
- package/src/generators/utils/add-jest.d.ts +0 -8
- package/src/generators/utils/add-jest.js +0 -36
- package/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/src/generators/utils/add-mf-env-to-inputs.js +0 -27
- package/src/generators/utils/ensure-angular-dependencies.d.ts +0 -2
- package/src/generators/utils/ensure-angular-dependencies.js +0 -35
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.d.ts +0 -2
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.js +0 -23
- package/src/generators/utils/update-project-root-tsconfig.d.ts +0 -3
- package/src/generators/utils/update-project-root-tsconfig.js +0 -26
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +0 -3
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +0 -50
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +0 -2
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +0 -75
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +0 -2
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +0 -183
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-17-1-0/update-angular-cli.js +0 -23
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts +0 -2
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +0 -37
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts +0 -2
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +0 -40
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts +0 -2
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.js +0 -26
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts +0 -2
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.js +0 -26
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-17-3-0/update-angular-cli.js +0 -23
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +0 -2
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +0 -26
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-18-1-0/update-angular-cli.js +0 -23
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -2
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-18-2-0/update-angular-cli.js +0 -23
- package/src/utils/targets.d.ts +0 -2
- package/src/utils/targets.js +0 -17
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.transform.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/options.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/options.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.di.js +0 -0
- /package/src/generators/host/files/common/{pre-v17/src → src}/main.server.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/setup-ssr/files/{root → base}/tsconfig.server.json__tpl__ +0 -0
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteGitKeepFilesIfNotNeeded = exports.deleteAngularJson = exports.updateVsCodeRecommendedExtensions = exports.getWorkspaceRootFileTypesInfo = exports.createRootKarmaConfig = exports.createWorkspaceFiles = exports.cleanupEsLintPackages = exports.updateRootEsLintConfig = exports.updatePackageJson = exports.updateRootTsConfig = exports.updateWorkspaceConfigDefaults = exports.createNxJson = exports.validateWorkspace = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const eslint_1 = require("@nx/eslint");
|
|
6
|
-
const setup_root_eslint_1 = require("@nx/eslint/src/generators/lint-project/setup-root-eslint");
|
|
7
6
|
const js_1 = require("@nx/js");
|
|
8
7
|
const default_base_1 = require("nx/src/utils/default-base");
|
|
9
8
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
@@ -29,7 +28,9 @@ exports.validateWorkspace = validateWorkspace;
|
|
|
29
28
|
function createNxJson(tree, options, defaultProject) {
|
|
30
29
|
const targets = getWorkspaceCommonTargets(tree);
|
|
31
30
|
(0, devkit_1.writeJson)(tree, 'nx.json', {
|
|
32
|
-
|
|
31
|
+
affected: {
|
|
32
|
+
defaultBase: options.defaultBase ?? (0, default_base_1.deduceDefaultBase)(),
|
|
33
|
+
},
|
|
33
34
|
namedInputs: {
|
|
34
35
|
sharedGlobals: [],
|
|
35
36
|
default: ['{projectRoot}/**/*', 'sharedGlobals'],
|
|
@@ -147,17 +148,23 @@ function updatePackageJson(tree) {
|
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
150
|
exports.updatePackageJson = updatePackageJson;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
function updateRootEsLintConfig(tree, existingEsLintConfig, unitTestRunner) {
|
|
152
|
+
if (tree.exists('.eslintrc.json')) {
|
|
153
|
+
/**
|
|
154
|
+
* If it still exists it means that there was no project at the root of the
|
|
155
|
+
* workspace, so it was not moved. In that case, we remove the file so the
|
|
156
|
+
* init generator do its work. We still receive the content of the file,
|
|
157
|
+
* so we update it after the init generator has run.
|
|
158
|
+
*/
|
|
159
|
+
tree.delete('.eslintrc.json');
|
|
160
|
+
}
|
|
161
|
+
(0, eslint_1.lintInitGenerator)(tree, { linter: eslint_1.Linter.EsLint, unitTestRunner });
|
|
154
162
|
if (!existingEsLintConfig) {
|
|
155
|
-
// There was no eslint config in the root, so we
|
|
156
|
-
(0, setup_root_eslint_1.setupRootEsLint)(tree, { unitTestRunner });
|
|
163
|
+
// There was no eslint config in the root, so we keep the generated one as-is.
|
|
157
164
|
return;
|
|
158
165
|
}
|
|
159
166
|
existingEsLintConfig.ignorePatterns = ['**/*'];
|
|
160
|
-
if (!(existingEsLintConfig.plugins ?? []).includes('@nx')) {
|
|
167
|
+
if (!(existingEsLintConfig.plugins ?? []).includes('@nrwl/nx')) {
|
|
161
168
|
existingEsLintConfig.plugins = Array.from(new Set([...(existingEsLintConfig.plugins ?? []), '@nx']));
|
|
162
169
|
}
|
|
163
170
|
existingEsLintConfig.overrides?.forEach((override) => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { createEffect, Actions, ofType } from '@ngrx/effects';
|
|
3
|
+
|
|
4
|
+
import * as <%= className %>Actions from './<%= fileName %>.actions';
|
|
5
|
+
import * as <%= className %>Feature from './<%= fileName %>.reducer';
|
|
6
|
+
|
|
7
|
+
import {switchMap, catchError, of} from 'rxjs';
|
|
8
|
+
|
|
9
|
+
@Injectable()
|
|
10
|
+
export class <%= className %>Effects {
|
|
11
|
+
init$ = createEffect(() => this.actions$.pipe(
|
|
12
|
+
ofType(<%= className %>Actions.init<%= className %>),
|
|
13
|
+
switchMap(() => of(<%= className %>Actions.load<%= className %>Success({ <%= propertyName %>: [] }))),
|
|
14
|
+
catchError((error) => {
|
|
15
|
+
console.error('Error', error);
|
|
16
|
+
return of(<%= className %>Actions.load<%= className %>Failure({ error }));
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
));
|
|
20
|
+
|
|
21
|
+
constructor(private readonly actions$: Actions) {}
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { select, Store, Action } from '@ngrx/store';
|
|
3
|
+
|
|
4
|
+
import * as <%= className %>Actions from './<%= fileName %>.actions';
|
|
5
|
+
import * as <%= className %>Feature from './<%= fileName %>.reducer';
|
|
6
|
+
import * as <%= className %>Selectors from './<%= fileName %>.selectors';
|
|
7
|
+
|
|
8
|
+
@Injectable()
|
|
9
|
+
export class <%= className %>Facade {
|
|
10
|
+
/**
|
|
11
|
+
* Combine pieces of state using createSelector,
|
|
12
|
+
* and expose them as observables through the facade.
|
|
13
|
+
*/
|
|
14
|
+
loaded$ = this.store.pipe(select(<%= className %>Selectors.select<%= className %>Loaded));
|
|
15
|
+
all<%= className %>$ = this.store.pipe(select(<%= className %>Selectors.selectAll<%= className %>));
|
|
16
|
+
selected<%= className %>$ = this.store.pipe(select(<%= className %>Selectors.selectEntity));
|
|
17
|
+
|
|
18
|
+
constructor(private readonly store: Store) {}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Use the initialization action to perform one
|
|
22
|
+
* or more tasks in your Effects.
|
|
23
|
+
*/
|
|
24
|
+
init() {
|
|
25
|
+
this.store.dispatch(<%= className %>Actions.init<%= className %>());
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -3,18 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateNgrxFilesFromTemplates = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const semver_1 = require("semver");
|
|
6
|
+
const version_utils_1 = require("../../utils/version-utils");
|
|
6
7
|
/**
|
|
7
8
|
* Generate 'feature' scaffolding: actions, reducer, effects, interfaces, selectors, facade
|
|
8
9
|
*/
|
|
9
10
|
function generateNgrxFilesFromTemplates(tree, options) {
|
|
10
11
|
const name = options.name;
|
|
11
12
|
const projectNames = (0, devkit_1.names)(name);
|
|
12
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.parentDirectory, {
|
|
13
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'base'), options.parentDirectory, {
|
|
13
14
|
...options,
|
|
14
15
|
...projectNames,
|
|
15
16
|
importFromOperators: (0, semver_1.lt)(options.rxjsVersion, '7.2.0'),
|
|
16
17
|
tmpl: '',
|
|
17
18
|
});
|
|
19
|
+
const angularVersion = (0, version_utils_1.getInstalledAngularVersion)(tree);
|
|
20
|
+
if ((0, semver_1.lt)(angularVersion, '14.1.0')) {
|
|
21
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'no-inject'), options.parentDirectory, {
|
|
22
|
+
...options,
|
|
23
|
+
...projectNames,
|
|
24
|
+
tmpl: '',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
18
27
|
if (!options.facade) {
|
|
19
28
|
tree.delete((0, devkit_1.joinPathFragments)(options.parentDirectory, options.directory, `${projectNames.fileName}.facade.ts`));
|
|
20
29
|
tree.delete((0, devkit_1.joinPathFragments)(options.parentDirectory, options.directory, `${projectNames.fileName}.facade.spec.ts`));
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateOptions = void 0;
|
|
4
|
+
const semver_1 = require("semver");
|
|
5
|
+
const version_utils_1 = require("../../utils/version-utils");
|
|
6
|
+
const version_utils_2 = require("../../../utils/version-utils");
|
|
4
7
|
function validateOptions(tree, options) {
|
|
5
8
|
if (!options.module && !options.parent) {
|
|
6
9
|
throw new Error('Please provide a value for "--parent"!');
|
|
@@ -11,5 +14,25 @@ function validateOptions(tree, options) {
|
|
|
11
14
|
if (options.parent && !tree.exists(options.parent)) {
|
|
12
15
|
throw new Error(`Parent does not exist: ${options.parent}.`);
|
|
13
16
|
}
|
|
17
|
+
const angularVersionInfo = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
18
|
+
const intendedNgRxVersionForAngularMajor = (0, version_utils_2.getPkgVersionForAngularMajorVersion)('ngrxVersion', angularVersionInfo.major);
|
|
19
|
+
const ngrxMajorVersion = (0, version_utils_1.getInstalledPackageVersionInfo)(tree, '@ngrx/store')?.major ??
|
|
20
|
+
(0, semver_1.major)((0, semver_1.coerce)(intendedNgRxVersionForAngularMajor));
|
|
21
|
+
if ((0, semver_1.lt)(angularVersionInfo.version, '14.1.0') || ngrxMajorVersion < 15) {
|
|
22
|
+
const parentPath = options.parent ?? options.module;
|
|
23
|
+
const parentContent = tree.read(parentPath, 'utf-8');
|
|
24
|
+
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
25
|
+
const ast = tsquery.ast(parentContent);
|
|
26
|
+
const NG_MODULE_DECORATOR_SELECTOR = 'ClassDeclaration > Decorator > CallExpression:has(Identifier[name=NgModule])';
|
|
27
|
+
const nodes = tsquery(ast, NG_MODULE_DECORATOR_SELECTOR, {
|
|
28
|
+
visitAllChildren: true,
|
|
29
|
+
});
|
|
30
|
+
if (nodes.length === 0) {
|
|
31
|
+
throw new Error(`The provided parent path "${parentPath}" does not contain an "NgModule". ` +
|
|
32
|
+
'Please make sure to provide a path to an "NgModule" where the state will be registered. ' +
|
|
33
|
+
'If you are trying to use a "Routes" definition file (for Standalone API usage), ' +
|
|
34
|
+
'please note this is not supported in Angular versions lower than 14.1.0.');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
14
37
|
}
|
|
15
38
|
exports.validateOptions = validateOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxNgrxGenerator",
|
|
4
4
|
"title": "Add NgRx support to an application or library.",
|
|
5
5
|
"description": "Adds NgRx support to an application or library.",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
},
|
|
43
43
|
"parent": {
|
|
44
44
|
"type": "string",
|
|
45
|
-
"description": "The path to the file where the state will be registered. For NgModule usage, this will be your `app.module.ts` for your root state, or your Feature Module for feature state. For Standalone API usage, this will be your `app.config.ts` file for your root state, or the Routes definition file for your feature state. The host directory will create/use the new state directory.",
|
|
45
|
+
"description": "The path to the file where the state will be registered. For NgModule usage, this will be your `app.module.ts` for your root state, or your Feature Module for feature state. For Standalone API usage, this will be your `app.config.ts` file for your root state, or the Routes definition file for your feature state. The host directory will create/use the new state directory. _Note: The Standalone API usage is only supported in Angular versions >= 14.1.0_.",
|
|
46
46
|
"x-prompt": "What is the path to the module or Routes definition where this NgRx state should be registered?",
|
|
47
47
|
"x-priority": "important"
|
|
48
48
|
},
|
|
49
49
|
"route": {
|
|
50
50
|
"type": "string",
|
|
51
|
-
"description": "The route that the Standalone NgRx Providers should be added to.",
|
|
51
|
+
"description": "The route that the Standalone NgRx Providers should be added to. _Note: This is only supported in Angular versions >= 14.1.0_.",
|
|
52
52
|
"default": "''"
|
|
53
53
|
},
|
|
54
54
|
"directory": {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { createEffect, Actions, ofType } from '@ngrx/effects';
|
|
3
|
+
|
|
4
|
+
import * as <%= className %>Actions from './<%= relativeFileName %>.actions';
|
|
5
|
+
import * as <%= className %>Feature from './<%= relativeFileName %>.reducer';
|
|
6
|
+
|
|
7
|
+
import {switchMap, catchError, of} from 'rxjs';
|
|
8
|
+
|
|
9
|
+
@Injectable()
|
|
10
|
+
export class <%= className %>Effects {
|
|
11
|
+
init$ = createEffect(() => this.actions$.pipe(
|
|
12
|
+
ofType(<%= className %>Actions.init<%= className %>),
|
|
13
|
+
switchMap(() => of(<%= className %>Actions.load<%= className %>Success({ <%= propertyName %>: [] }))),
|
|
14
|
+
catchError((error) => {
|
|
15
|
+
console.error('Error', error);
|
|
16
|
+
return of(<%= className %>Actions.load<%= className %>Failure({ error }));
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
));
|
|
20
|
+
|
|
21
|
+
constructor(private readonly actions$: Actions) {}
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { select, Store, Action } from '@ngrx/store';
|
|
3
|
+
|
|
4
|
+
import * as <%= className %>Actions from './<%= relativeFileName %>.actions';
|
|
5
|
+
import * as <%= className %>Feature from './<%= relativeFileName %>.reducer';
|
|
6
|
+
import * as <%= className %>Selectors from './<%= relativeFileName %>.selectors';
|
|
7
|
+
|
|
8
|
+
@Injectable()
|
|
9
|
+
export class <%= className %>Facade {
|
|
10
|
+
/**
|
|
11
|
+
* Combine pieces of state using createSelector,
|
|
12
|
+
* and expose them as observables through the facade.
|
|
13
|
+
*/
|
|
14
|
+
loaded$ = this.store.pipe(select(<%= className %>Selectors.select<%= className %>Loaded));
|
|
15
|
+
all<%= className %>$ = this.store.pipe(select(<%= className %>Selectors.selectAll<%= className %>));
|
|
16
|
+
selected<%= className %>$ = this.store.pipe(select(<%= className %>Selectors.selectEntity));
|
|
17
|
+
|
|
18
|
+
constructor(private readonly store: Store) {}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Use the initialization action to perform one
|
|
22
|
+
* or more tasks in your Effects.
|
|
23
|
+
*/
|
|
24
|
+
init() {
|
|
25
|
+
this.store.dispatch(<%= className %>Actions.init<%= className %>());
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateFilesFromTemplates = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const semver_1 = require("semver");
|
|
6
|
+
const version_utils_1 = require("../../utils/version-utils");
|
|
6
7
|
function generateFilesFromTemplates(tree, options) {
|
|
7
8
|
const projectNames = (0, devkit_1.names)(options.name);
|
|
8
9
|
const fileName = options.subdirectory
|
|
9
10
|
? (0, devkit_1.joinPathFragments)(options.subdirectory, projectNames.fileName)
|
|
10
11
|
: projectNames.fileName;
|
|
11
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.parentDirectory, {
|
|
12
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'base'), options.parentDirectory, {
|
|
12
13
|
...options,
|
|
13
14
|
...projectNames,
|
|
14
15
|
fileName,
|
|
@@ -16,6 +17,16 @@ function generateFilesFromTemplates(tree, options) {
|
|
|
16
17
|
importFromOperators: (0, semver_1.lt)(options.rxjsVersion, '7.2.0'),
|
|
17
18
|
tmpl: '',
|
|
18
19
|
});
|
|
20
|
+
const angularVersion = (0, version_utils_1.getInstalledAngularVersion)(tree);
|
|
21
|
+
if ((0, semver_1.lt)(angularVersion, '14.1.0')) {
|
|
22
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'no-inject'), options.parentDirectory, {
|
|
23
|
+
...options,
|
|
24
|
+
...projectNames,
|
|
25
|
+
fileName,
|
|
26
|
+
relativeFileName: projectNames.fileName,
|
|
27
|
+
tmpl: '',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
19
30
|
if (!options.facade) {
|
|
20
31
|
tree.delete((0, devkit_1.joinPathFragments)(options.parentDirectory, options.directory, `${options.subdirectory ? `${options.subdirectory}/` : ''}${projectNames.fileName}.facade.ts`));
|
|
21
32
|
tree.delete((0, devkit_1.joinPathFragments)(options.parentDirectory, options.directory, `${options.subdirectory ? `${options.subdirectory}/` : ''}${projectNames.fileName}.facade.spec.ts`));
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateOptions = void 0;
|
|
4
|
+
const version_utils_1 = require("../..//utils/version-utils");
|
|
5
|
+
const version_utils_2 = require("../../../utils/version-utils");
|
|
6
|
+
const semver_1 = require("semver");
|
|
4
7
|
function validateOptions(tree, options) {
|
|
5
8
|
if (!options.parent) {
|
|
6
9
|
throw new Error('Please provide a value for "--parent"!');
|
|
@@ -8,5 +11,24 @@ function validateOptions(tree, options) {
|
|
|
8
11
|
if (options.parent && !tree.exists(options.parent)) {
|
|
9
12
|
throw new Error(`Parent does not exist: ${options.parent}.`);
|
|
10
13
|
}
|
|
14
|
+
const angularVersionInfo = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
15
|
+
const intendedNgRxVersionForAngularMajor = (0, version_utils_2.getPkgVersionForAngularMajorVersion)('ngrxVersion', angularVersionInfo.major);
|
|
16
|
+
const ngrxMajorVersion = (0, version_utils_1.getInstalledPackageVersionInfo)(tree, '@ngrx/store')?.major ??
|
|
17
|
+
(0, semver_1.major)((0, semver_1.coerce)(intendedNgRxVersionForAngularMajor));
|
|
18
|
+
if ((0, semver_1.lt)(angularVersionInfo.version, '14.1.0') || ngrxMajorVersion < 15) {
|
|
19
|
+
const parentContent = tree.read(options.parent, 'utf-8');
|
|
20
|
+
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
21
|
+
const ast = tsquery.ast(parentContent);
|
|
22
|
+
const NG_MODULE_DECORATOR_SELECTOR = 'ClassDeclaration > Decorator > CallExpression:has(Identifier[name=NgModule])';
|
|
23
|
+
const nodes = tsquery(ast, NG_MODULE_DECORATOR_SELECTOR, {
|
|
24
|
+
visitAllChildren: true,
|
|
25
|
+
});
|
|
26
|
+
if (nodes.length === 0) {
|
|
27
|
+
throw new Error(`The provided parent path "${options.parent}" does not contain an "NgModule". ` +
|
|
28
|
+
'Please make sure to provide a path to an "NgModule" where the state will be registered. ' +
|
|
29
|
+
'If you are trying to use a "Routes" definition file (for Standalone API usage), ' +
|
|
30
|
+
'please note this is not supported in Angular versions lower than 14.1.0.');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
11
33
|
}
|
|
12
34
|
exports.validateOptions = validateOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxNgrxFeatureStoreGenerator",
|
|
4
4
|
"title": "NgRx Feature Store Generator",
|
|
5
5
|
"description": "Add an NgRx Feature Store to an application or library.",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"parent": {
|
|
20
20
|
"type": "string",
|
|
21
|
-
"description": "The path to the file where the state will be registered. For NgModule usage, this will be your Feature Module. For Standalone API usage, this will be your Routes definition file for your feature state. The host directory will create/use the new state directory.",
|
|
21
|
+
"description": "The path to the file where the state will be registered. For NgModule usage, this will be your Feature Module. For Standalone API usage, this will be your Routes definition file for your feature state. The host directory will create/use the new state directory. _Note: The Standalone API usage is only supported in Angular versions >= 14.1.0_.",
|
|
22
22
|
"x-prompt": "What is the path to the module or Routes definition where this NgRx state should be registered?",
|
|
23
23
|
"x-priority": "important"
|
|
24
24
|
},
|
|
25
25
|
"route": {
|
|
26
26
|
"type": "string",
|
|
27
|
-
"description": "The route that the Standalone NgRx Providers should be added to.",
|
|
27
|
+
"description": "The route that the Standalone NgRx Providers should be added to. _Note: This is only supported in Angular versions >= 14.1.0_.",
|
|
28
28
|
"default": "''"
|
|
29
29
|
},
|
|
30
30
|
"minimal": {
|
|
@@ -16,7 +16,7 @@ function normalizeOptions(tree, options) {
|
|
|
16
16
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
17
17
|
const isStandalone = (0, ast_utils_1.isNgStandaloneApp)(tree, options.project);
|
|
18
18
|
const appConfigPath = (0, devkit_1.joinPathFragments)(project.sourceRoot, 'app/app.config.ts');
|
|
19
|
-
const appMainPath = project.targets.build.options.main
|
|
19
|
+
const appMainPath = project.targets.build.options.main;
|
|
20
20
|
/** If NgModule App
|
|
21
21
|
* -> Use App Module
|
|
22
22
|
* If Standalone
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateOptions = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const version_utils_1 = require("../../utils/version-utils");
|
|
6
|
+
const version_utils_2 = require("../../../utils/version-utils");
|
|
7
|
+
const semver_1 = require("semver");
|
|
8
|
+
const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
|
|
5
9
|
function validateOptions(tree, options) {
|
|
6
10
|
if (!(0, devkit_1.getProjects)(tree).has(options.project)) {
|
|
7
11
|
throw new Error(`Could not find project '${options.project}'. Please ensure the project name is correct and exists.`);
|
|
@@ -13,5 +17,16 @@ function validateOptions(tree, options) {
|
|
|
13
17
|
if (!options.minimal && !options.name) {
|
|
14
18
|
throw new Error(`If generating a global feature state with your root store, you must provide a name for it with '--name'.`);
|
|
15
19
|
}
|
|
20
|
+
const angularVersionInfo = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
21
|
+
const intendedNgRxVersionForAngularMajor = (0, version_utils_2.getPkgVersionForAngularMajorVersion)('ngrxVersion', angularVersionInfo.major);
|
|
22
|
+
const ngrxMajorVersion = (0, version_utils_1.getInstalledPackageVersionInfo)(tree, '@ngrx/store')?.major ??
|
|
23
|
+
(0, semver_1.major)((0, semver_1.coerce)(intendedNgRxVersionForAngularMajor));
|
|
24
|
+
const isStandalone = (0, ast_utils_1.isNgStandaloneApp)(tree, options.project);
|
|
25
|
+
if ((0, semver_1.lt)(angularVersionInfo.version, '14.1.0') || ngrxMajorVersion < 15) {
|
|
26
|
+
if (isStandalone) {
|
|
27
|
+
throw new Error(`The provided project '${options.project}' is set up to use Standalone APIs, however your workspace is not configured to support Standalone APIs. ` +
|
|
28
|
+
'Please make sure to provide a path to an "NgModule" where the state will be registered. ');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
16
31
|
}
|
|
17
32
|
exports.validateOptions = validateOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"$id": "NxNgrxRootStoreGenerator",
|
|
4
4
|
"title": "Add NgRx support to an application.",
|
|
5
5
|
"description": "Adds NgRx support to an application.",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"route": {
|
|
31
31
|
"type": "string",
|
|
32
|
-
"description": "The route that the Standalone NgRx Providers should be added to.",
|
|
32
|
+
"description": "The route that the Standalone NgRx Providers should be added to. _Note: This is only supported in Angular versions >= 14.1.0_.",
|
|
33
33
|
"default": "''"
|
|
34
34
|
},
|
|
35
35
|
"directory": {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateOptions = void 0;
|
|
4
|
+
const validations_1 = require("../../utils/validations");
|
|
5
|
+
function validateOptions(tree, options) {
|
|
6
|
+
(0, validations_1.validateStandaloneOption)(tree, options.standalone);
|
|
7
|
+
}
|
|
8
|
+
exports.validateOptions = validateOptions;
|
|
@@ -5,6 +5,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
6
|
const lib_1 = require("./lib");
|
|
7
7
|
async function pipeGenerator(tree, rawOptions) {
|
|
8
|
+
(0, lib_1.validateOptions)(tree, rawOptions);
|
|
8
9
|
const options = await (0, lib_1.normalizeOptions)(tree, rawOptions);
|
|
9
10
|
const pipeNames = (0, devkit_1.names)(options.name);
|
|
10
11
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.directory, {
|
|
@@ -11,15 +11,15 @@ export interface Schema {
|
|
|
11
11
|
export?: boolean;
|
|
12
12
|
skipFormat?: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx
|
|
14
|
+
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18.
|
|
15
15
|
*/
|
|
16
16
|
flat?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
* @deprecated Provide the `directory` option instead. It will be removed in Nx
|
|
18
|
+
* @deprecated Provide the `directory` option instead. It will be removed in Nx v18.
|
|
19
19
|
*/
|
|
20
20
|
path?: string;
|
|
21
21
|
/**
|
|
22
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx
|
|
22
|
+
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v18.
|
|
23
23
|
*/
|
|
24
24
|
project?: string;
|
|
25
25
|
}
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"$source": "projectName"
|
|
35
35
|
},
|
|
36
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
|
|
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 v18."
|
|
38
38
|
},
|
|
39
39
|
"flat": {
|
|
40
40
|
"type": "boolean",
|
|
41
41
|
"default": true,
|
|
42
42
|
"description": "When true (the default) creates files at the top level of the project.",
|
|
43
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx
|
|
43
|
+
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18."
|
|
44
44
|
},
|
|
45
45
|
"skipTests": {
|
|
46
46
|
"type": "boolean",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"description": "Do not import this pipe into the owning NgModule."
|
|
54
54
|
},
|
|
55
55
|
"standalone": {
|
|
56
|
-
"description": "Whether the generated pipe is standalone.",
|
|
56
|
+
"description": "Whether the generated pipe is standalone. _Note: This is only supported in Angular versions >= 14.1.0_.",
|
|
57
57
|
"type": "boolean",
|
|
58
|
-
"default":
|
|
58
|
+
"default": false
|
|
59
59
|
},
|
|
60
60
|
"module": {
|
|
61
61
|
"type": "string",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {withModuleFederationForSSR} from '@nx/angular/module-federation';
|
|
2
2
|
import config from './module-federation.config';
|
|
3
3
|
|
|
4
|
-
export default withModuleFederationForSSR(config)
|
|
4
|
+
export default withModuleFederationForSSR(config)
|
|
@@ -31,15 +31,17 @@ export function app(): express.Express {
|
|
|
31
31
|
server.set('view engine', 'html');
|
|
32
32
|
server.set('views', browserBundles);
|
|
33
33
|
|
|
34
|
+
|
|
34
35
|
// Example Express Rest API endpoints
|
|
35
36
|
// server.get('/api/**', (req, res) => { });
|
|
36
37
|
// Serve static files from /browser
|
|
37
38
|
// serve static files
|
|
38
|
-
server.
|
|
39
|
+
server.use('/', express.static(browserBundles, { maxAge: '1y' }));
|
|
39
40
|
server.use('/server', express.static(serverBundles, { maxAge: '1y' }));
|
|
40
41
|
|
|
41
42
|
// All regular routes use the Universal engine
|
|
42
43
|
server.get('*', (req, res) => {
|
|
44
|
+
|
|
43
45
|
res.render(indexHtml, {
|
|
44
46
|
req,
|
|
45
47
|
providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Tree } from '@nx/devkit';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function addSsr(tree: Tree, { appName, port, standalone, typescriptConfiguration, }: {
|
|
3
3
|
appName: string;
|
|
4
4
|
port: number;
|
|
5
5
|
standalone: boolean;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addSsr = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const setup_ssr_1 = require("../../setup-ssr/setup-ssr");
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
|
-
|
|
8
|
-
async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfiguration, }) {
|
|
7
|
+
async function addSsr(tree, { appName, port, standalone, typescriptConfiguration, }) {
|
|
9
8
|
let project = (0, devkit_1.readProjectConfiguration)(tree, appName);
|
|
9
|
+
await (0, setup_ssr_1.default)(tree, {
|
|
10
|
+
project: appName,
|
|
11
|
+
standalone,
|
|
12
|
+
});
|
|
10
13
|
tree.rename((0, devkit_1.joinPathFragments)(project.sourceRoot, 'main.server.ts'), (0, devkit_1.joinPathFragments)(project.sourceRoot, 'bootstrap.server.ts'));
|
|
11
14
|
tree.write((0, devkit_1.joinPathFragments)(project.root, 'server.ts'), "import('./src/main.server');");
|
|
12
|
-
const browserBundleOutput = project.targets.build.options.outputPath;
|
|
13
|
-
const serverBundleOutput = project.targets.build.options.outputPath
|
|
14
|
-
|
|
15
|
-
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, '../files/common', angularMajorVersion >= 17 ? 'v17+' : 'pre-v17'), project.root, {
|
|
15
|
+
const browserBundleOutput = (0, devkit_1.joinPathFragments)(project.targets.build.options.outputPath, 'browser');
|
|
16
|
+
const serverBundleOutput = (0, devkit_1.joinPathFragments)(project.targets.build.options.outputPath, 'server');
|
|
17
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, `../files/common`), project.root, {
|
|
16
18
|
appName,
|
|
17
19
|
browserBundleOutput,
|
|
18
20
|
serverBundleOutput,
|
|
@@ -50,10 +52,12 @@ async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfi
|
|
|
50
52
|
(0, devkit_1.updateProjectConfiguration)(tree, appName, project);
|
|
51
53
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
52
54
|
cors: versions_1.corsVersion,
|
|
55
|
+
express: versions_1.expressVersion,
|
|
53
56
|
'@module-federation/node': versions_1.moduleFederationNodeVersion,
|
|
54
57
|
}, {
|
|
55
58
|
'@types/cors': versions_1.typesCorsVersion,
|
|
59
|
+
'@types/express': versions_1.typesExpressVersion,
|
|
56
60
|
});
|
|
57
61
|
return installTask;
|
|
58
62
|
}
|
|
59
|
-
exports.
|
|
63
|
+
exports.addSsr = addSsr;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './find-next-available-port';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './add-ssr';
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./find-next-available-port"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./
|
|
5
|
+
tslib_1.__exportStar(require("./add-ssr"), exports);
|