@nx/angular 20.2.0-canary.20241130-ec5a5e6 → 20.2.0-canary.20241204-75b2080
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/executors.json +1 -1
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular-testing.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.json +1 -1
- package/migrations.json +160 -1
- package/package.json +12 -19
- 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.json +3 -4
- 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 -6
- package/src/executors/application/utils/normalize-options.d.ts +2 -0
- package/src/executors/application/utils/normalize-options.js +33 -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 -1
- package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -1
- 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 +2 -26
- package/src/executors/module-federation-dev-server/schema.d.ts +1 -0
- 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 -33
- package/src/executors/module-federation-ssr-dev-server/schema.d.ts +8 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +1 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +11 -20
- 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 +0 -8
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +1 -2
- 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 +1 -1
- package/src/executors/package/schema.d.ts +1 -3
- package/src/executors/package/schema.json +0 -10
- package/src/executors/utilities/ng-packagr/{stylesheet-processor.js → pre-v19/stylesheet-processor.js} +2 -2
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +11 -5
- 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 +23 -0
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +93 -0
- package/src/generators/application/application.js +1 -0
- 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/standalone-components/src/app/app.component.ts__tpl__ +4 -6
- package/src/generators/application/lib/add-serve-static-target.d.ts +1 -1
- package/src/generators/application/lib/add-serve-static-target.js +1 -3
- package/src/generators/application/lib/create-files.js +4 -1
- package/src/generators/application/lib/create-project.js +24 -31
- package/src/generators/application/lib/normalize-options.js +1 -6
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +7 -2
- package/src/generators/component/component.js +4 -0
- 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 +2 -0
- package/src/generators/component/schema.d.ts +1 -0
- package/src/generators/component/schema.json +5 -0
- 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/directive/directive.js +5 -0
- package/src/generators/directive/files/__fileName__.ts__tpl__ +2 -2
- package/src/generators/directive/lib/normalize-options.js +3 -1
- package/src/generators/host/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
- package/src/generators/host/lib/update-ssr-setup.js +2 -1
- package/src/generators/host/schema.d.ts +1 -0
- package/src/generators/host/schema.json +4 -0
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +2 -2
- package/src/generators/pipe/lib/normalize-options.js +3 -1
- package/src/generators/pipe/pipe.js +5 -0
- package/src/generators/remote/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
- package/src/generators/remote/lib/update-ssr-setup.js +2 -1
- package/src/generators/remote/schema.d.ts +1 -0
- package/src/generators/remote/schema.json +4 -0
- package/src/generators/scam/lib/normalize-options.js +3 -1
- package/src/generators/scam-directive/lib/normalize-options.js +3 -1
- package/src/generators/scam-pipe/lib/normalize-options.js +3 -1
- 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/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/lib/add-remote-entry.js +5 -0
- 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__ +65 -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 +20 -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 +23 -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 +36 -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} +4 -15
- package/src/generators/setup-tailwind/setup-tailwind.js +4 -1
- package/src/generators/utils/add-jest.js +4 -8
- package/src/generators/utils/storybook-ast/component-info.js +12 -2
- package/src/generators/utils/validations.d.ts +1 -0
- package/src/generators/utils/validations.js +10 -0
- package/src/generators/utils/version-utils.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 +48 -0
- package/src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone.d.ts +2 -0
- package/src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone.js +55 -0
- package/src/migrations/update-20-2-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-20-2-0/update-angular-cli.js +23 -0
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.d.ts +2 -0
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.js +55 -0
- package/src/utils/backward-compatible-versions.d.ts +4 -4
- package/src/utils/backward-compatible-versions.js +20 -19
- package/src/utils/nx-devkit/ast-utils.d.ts +10 -1
- package/src/utils/nx-devkit/ast-utils.js +32 -9
- package/src/utils/versions.d.ts +7 -7
- package/src/utils/versions.js +7 -7
- package/esm2022/index.mjs +0 -2
- package/esm2022/mf/index.mjs +0 -2
- package/esm2022/mf/mf.mjs +0 -116
- 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/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/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/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/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.transform.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.transform.js +0 -0
- /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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
3
|
"title": "Schema for Nx Application Executor",
|
|
4
|
-
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.
|
|
4
|
+
"description": "Builds an Angular application using [esbuild](https://esbuild.github.io/) with integrated SSR and prerendering capabilities.",
|
|
5
5
|
"examplesFile": "../../../docs/application-executor-examples.md",
|
|
6
6
|
"outputCapture": "direct-nodejs",
|
|
7
7
|
"type": "object",
|
|
@@ -20,7 +20,18 @@
|
|
|
20
20
|
},
|
|
21
21
|
"server": {
|
|
22
22
|
"type": "string",
|
|
23
|
-
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
|
23
|
+
"description": "The full path for the server entry point to the application, relative to the current workspace.",
|
|
24
|
+
"oneOf": [
|
|
25
|
+
{
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"const": false,
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "Indicates that a server entry point is not provided. _Note: this is only supported in Angular versions >= 19.0.0_."
|
|
33
|
+
}
|
|
34
|
+
]
|
|
24
35
|
},
|
|
25
36
|
"polyfills": {
|
|
26
37
|
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
@@ -39,6 +50,31 @@
|
|
|
39
50
|
"type": "string",
|
|
40
51
|
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations. _Note: this is only supported in Angular versions >= 17.3.0_."
|
|
41
52
|
},
|
|
53
|
+
"security": {
|
|
54
|
+
"description": "Security features to protect against XSS and other common attacks. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"autoCsp": {
|
|
59
|
+
"description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases. It defaults to `false`.",
|
|
60
|
+
"oneOf": [
|
|
61
|
+
{
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"unsafeEval": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"description": "Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in the auto-CSP. Please only enable this if you are absolutely sure that you need to, as allowing calls to eval will weaken the XSS defenses provided by the auto-CSP. It default to `false`."
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
42
78
|
"scripts": {
|
|
43
79
|
"description": "Global scripts to be included in the build.",
|
|
44
80
|
"type": "array",
|
|
@@ -127,6 +163,34 @@
|
|
|
127
163
|
"type": "string"
|
|
128
164
|
},
|
|
129
165
|
"default": []
|
|
166
|
+
},
|
|
167
|
+
"sass": {
|
|
168
|
+
"description": "Options to pass to the sass preprocessor. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
|
169
|
+
"type": "object",
|
|
170
|
+
"properties": {
|
|
171
|
+
"fatalDeprecations": {
|
|
172
|
+
"description": "A set of deprecations to treat as fatal. If a deprecation warning of any provided type is encountered during compilation, the compiler will error instead. If a Version is provided, then all deprecations that were active in that compiler version will be treated as fatal.",
|
|
173
|
+
"type": "array",
|
|
174
|
+
"items": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"silenceDeprecations": {
|
|
179
|
+
"description": " A set of active deprecations to ignore. If a deprecation warning of any provided type is encountered during compilation, the compiler will ignore it instead.",
|
|
180
|
+
"type": "array",
|
|
181
|
+
"items": {
|
|
182
|
+
"type": "string"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"futureDeprecations": {
|
|
186
|
+
"description": "A set of future deprecations to opt into early. Future deprecations passed here will be treated as active by the compiler, emitting warnings as necessary.",
|
|
187
|
+
"type": "array",
|
|
188
|
+
"items": {
|
|
189
|
+
"type": "string"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"additionalProperties": false
|
|
130
194
|
}
|
|
131
195
|
},
|
|
132
196
|
"additionalProperties": false
|
|
@@ -480,8 +544,7 @@
|
|
|
480
544
|
"default": []
|
|
481
545
|
},
|
|
482
546
|
"prerender": {
|
|
483
|
-
"description": "Prerender (SSG) pages of your application during build time.",
|
|
484
|
-
"default": false,
|
|
547
|
+
"description": "Prerender (SSG) pages of your application during build time. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`.",
|
|
485
548
|
"oneOf": [
|
|
486
549
|
{
|
|
487
550
|
"type": "boolean",
|
|
@@ -518,6 +581,11 @@
|
|
|
518
581
|
"entry": {
|
|
519
582
|
"type": "string",
|
|
520
583
|
"description": "The server entry-point that when executed will spawn the web server."
|
|
584
|
+
},
|
|
585
|
+
"experimentalPlatform": {
|
|
586
|
+
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the feature may undergo changes in future versions. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
|
587
|
+
"default": "node",
|
|
588
|
+
"enum": ["node", "neutral"]
|
|
521
589
|
}
|
|
522
590
|
},
|
|
523
591
|
"additionalProperties": false
|
|
@@ -526,8 +594,12 @@
|
|
|
526
594
|
},
|
|
527
595
|
"appShell": {
|
|
528
596
|
"type": "boolean",
|
|
529
|
-
"description": "Generates an application shell during build time."
|
|
530
|
-
|
|
597
|
+
"description": "Generates an application shell during build time. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`."
|
|
598
|
+
},
|
|
599
|
+
"outputMode": {
|
|
600
|
+
"type": "string",
|
|
601
|
+
"description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR). _Note: this is only supported in Angular versions >= 19.0.0_.",
|
|
602
|
+
"enum": ["static", "server"]
|
|
531
603
|
},
|
|
532
604
|
"buildLibsFromSource": {
|
|
533
605
|
"type": "boolean",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = normalizeOptions;
|
|
4
|
+
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
5
|
+
function normalizeOptions(options) {
|
|
6
|
+
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
7
|
+
/**
|
|
8
|
+
* We can't set the default values for `security.autoCsp` and
|
|
9
|
+
* `security.autoCsp.unsafeEval` in the schema because our current schema
|
|
10
|
+
* parsing would (incorrectly?) default `security` to an object with the
|
|
11
|
+
* `autoCsp` property set to `false`. This would be problematic because the
|
|
12
|
+
* option is not supported in Angular versions < 19. So, we don't set those
|
|
13
|
+
* defaults in the schema and we normalize them here correctly.
|
|
14
|
+
*/
|
|
15
|
+
let security = options.security;
|
|
16
|
+
if (angularMajorVersion >= 19) {
|
|
17
|
+
if (typeof security === 'object') {
|
|
18
|
+
if (security.autoCsp === undefined) {
|
|
19
|
+
security.autoCsp = false;
|
|
20
|
+
}
|
|
21
|
+
else if (typeof security.autoCsp === 'object' &&
|
|
22
|
+
security.autoCsp.unsafeEval === undefined) {
|
|
23
|
+
security.autoCsp.unsafeEval = false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
...options,
|
|
29
|
+
appShell: angularMajorVersion < 19 ? options.appShell ?? false : undefined,
|
|
30
|
+
prerender: angularMajorVersion < 19 ? options.prerender ?? false : undefined,
|
|
31
|
+
security,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -4,10 +4,7 @@ exports.validateOptions = validateOptions;
|
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
6
6
|
function validateOptions(options) {
|
|
7
|
-
const {
|
|
8
|
-
if (angularMajorVersion < 17) {
|
|
9
|
-
throw new Error(`The "application" executor requires Angular version 17 or greater. You are currently using version ${angularVersion}.`);
|
|
10
|
-
}
|
|
7
|
+
const { version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
11
8
|
if ((0, semver_1.lt)(angularVersion, '17.1.0')) {
|
|
12
9
|
if (options.loader) {
|
|
13
10
|
throw new Error(`The "loader" option requires Angular version 17.1.0 or greater. You are currently using version ${angularVersion}.`);
|
|
@@ -48,4 +45,21 @@ function validateOptions(options) {
|
|
|
48
45
|
throw new Error(`The "deployUrl" option requires Angular version 17.3.0 or greater. You are currently using version ${angularVersion}.`);
|
|
49
46
|
}
|
|
50
47
|
}
|
|
48
|
+
if ((0, semver_1.lt)(angularVersion, '19.0.0')) {
|
|
49
|
+
if (options.outputMode) {
|
|
50
|
+
throw new Error(`The "outputMode" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
51
|
+
}
|
|
52
|
+
if (options.stylePreprocessorOptions?.sass) {
|
|
53
|
+
throw new Error(`The "stylePreprocessorOptions.sass" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
54
|
+
}
|
|
55
|
+
if (typeof options.ssr === 'object' && options.ssr?.experimentalPlatform) {
|
|
56
|
+
throw new Error(`The "ssr.experimentalPlatform" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
57
|
+
}
|
|
58
|
+
if (options.security !== undefined) {
|
|
59
|
+
throw new Error(`The "security" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
60
|
+
}
|
|
61
|
+
if (typeof options.server === 'boolean' && options.server === false) {
|
|
62
|
+
throw new Error(`The "false" value for the "server" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
51
65
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { buildEsbuildBrowser as buildEsbuildBrowserFn } from '@angular-devkit/build-angular/src/builders/browser-esbuild';
|
|
2
|
-
import {
|
|
2
|
+
import type { ExecutorContext } from '@nx/devkit';
|
|
3
3
|
import type { EsBuildSchema } from './schema';
|
|
4
4
|
export default function esbuildExecutor(options: EsBuildSchema, context: ExecutorContext): ReturnType<typeof buildEsbuildBrowserFn>;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = esbuildExecutor;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
4
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
6
|
-
const angular_version_utils_1 = require("../utilities/angular-version-utils");
|
|
7
5
|
const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
8
6
|
const esbuild_extensions_1 = require("../utilities/esbuild-extensions");
|
|
9
7
|
async function* esbuildExecutor(options, context) {
|
|
10
|
-
if (options.plugins) {
|
|
11
|
-
const { major: angularMajorVersion, version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
12
|
-
if (angularMajorVersion < 17) {
|
|
13
|
-
throw new Error((0, devkit_1.stripIndents) `The "plugins" option is only supported in Angular >= 17.0.0. You are currently using "${angularVersion}".
|
|
14
|
-
You can resolve this error by removing the "plugins" option or by migrating to Angular 17.0.0.`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
8
|
options.buildLibsFromSource ??= true;
|
|
18
9
|
const { buildLibsFromSource, plugins: pluginPaths, ...delegateExecutorOptions } = options;
|
|
19
10
|
let dependencies;
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"default": true
|
|
442
442
|
},
|
|
443
443
|
"plugins": {
|
|
444
|
-
"description": "A list of ESBuild plugins.
|
|
444
|
+
"description": "A list of ESBuild plugins.",
|
|
445
445
|
"type": "array",
|
|
446
446
|
"items": {
|
|
447
447
|
"oneOf": [
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./build-static-remotes"), exports);
|
|
5
4
|
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
6
5
|
tslib_1.__exportStar(require("./start-dev-remotes"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./start-static-remotes-file-server"), exports);
|
|
@@ -21,6 +21,7 @@ function normalizeOptions(schema) {
|
|
|
21
21
|
liveReload: schema.liveReload ?? true,
|
|
22
22
|
open: schema.open ?? false,
|
|
23
23
|
ssl: schema.ssl ?? false,
|
|
24
|
+
verbose: schema.verbose ?? false,
|
|
24
25
|
sslCert: schema.sslCert ? (0, path_1.join)(devkit_1.workspaceRoot, schema.sslCert) : undefined,
|
|
25
26
|
sslKey: schema.sslKey ? (0, path_1.join)(devkit_1.workspaceRoot, schema.sslKey) : undefined,
|
|
26
27
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Schema } from '../schema';
|
|
2
2
|
import { type ExecutorContext, type ProjectConfiguration } from '@nx/devkit';
|
|
3
|
-
export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Schema, context: ExecutorContext, target?: 'serve' | 'serve-static'): Promise<AsyncIterable<{
|
|
3
|
+
export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Pick<Schema, 'devRemotes' | 'verbose'>, context: ExecutorContext, target?: 'serve' | 'serve-static'): Promise<AsyncIterable<{
|
|
4
4
|
success: boolean;
|
|
5
5
|
}>[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ExecutorContext } from '@nx/devkit';
|
|
2
2
|
import { type Schema } from './schema';
|
|
3
|
-
export declare function moduleFederationDevServerExecutor(schema: Schema, context: ExecutorContext): AsyncGenerator<any, any,
|
|
3
|
+
export declare function moduleFederationDevServerExecutor(schema: Schema, context: ExecutorContext): AsyncGenerator<any, any, any>;
|
|
4
4
|
export default moduleFederationDevServerExecutor;
|
|
@@ -6,7 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const lib_1 = require("./lib");
|
|
7
7
|
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
8
8
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
9
|
-
const utils_1 = require("@nx/module-federation/src/utils");
|
|
9
|
+
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
10
10
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
11
11
|
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
12
12
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
@@ -15,8 +15,6 @@ const module_federation_1 = require("../../builders/utilities/module-federation"
|
|
|
15
15
|
const path_1 = require("path");
|
|
16
16
|
const fs_1 = require("fs");
|
|
17
17
|
async function* moduleFederationDevServerExecutor(schema, context) {
|
|
18
|
-
// Force Node to resolve to look for the nx binary that is inside node_modules
|
|
19
|
-
const nxBin = require.resolve('nx/bin/nx');
|
|
20
18
|
const options = (0, lib_1.normalizeOptions)(schema);
|
|
21
19
|
const { projects: workspaceProjects } = (0, devkit_1.readProjectsConfigurationFromProjectGraph)(context.projectGraph);
|
|
22
20
|
const project = workspaceProjects[context.projectName];
|
|
@@ -55,29 +53,7 @@ async function* moduleFederationDevServerExecutor(schema, context) {
|
|
|
55
53
|
pathToManifestFile = userPathToManifestFile;
|
|
56
54
|
}
|
|
57
55
|
(0, module_federation_1.validateDevRemotes)(options, workspaceProjects);
|
|
58
|
-
const
|
|
59
|
-
const remoteNames = options.devRemotes.map((r) => typeof r === 'string' ? r : r.remoteName);
|
|
60
|
-
const remotes = (0, utils_1.getRemotes)(remoteNames, options.skipRemotes, moduleFederationConfig, {
|
|
61
|
-
projectName: project.name,
|
|
62
|
-
projectGraph: context.projectGraph,
|
|
63
|
-
root: context.root,
|
|
64
|
-
}, pathToManifestFile);
|
|
65
|
-
options.staticRemotesPort ??= remotes.staticRemotePort;
|
|
66
|
-
// Set NX_MF_DEV_REMOTES for the Nx Runtime Library Control Plugin
|
|
67
|
-
process.env.NX_MF_DEV_REMOTES = JSON.stringify([
|
|
68
|
-
...(remotes.devRemotes.map((r) => typeof r === 'string' ? r : r.remoteName) ?? []).map((r) => r.replace(/-/g, '_')),
|
|
69
|
-
project.name.replace(/-/g, '_'),
|
|
70
|
-
]);
|
|
71
|
-
const staticRemotesConfig = (0, utils_1.parseStaticRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
72
|
-
const mappedLocationsOfStaticRemotes = await (0, lib_1.buildStaticRemotes)(staticRemotesConfig, nxBin, context, options);
|
|
73
|
-
const devRemoteIters = await (0, lib_1.startRemotes)(remotes.devRemotes, workspaceProjects, options, context, 'serve');
|
|
74
|
-
const staticRemotesIter = (0, lib_1.startStaticRemotesFileServer)(staticRemotesConfig, context, options);
|
|
75
|
-
(0, utils_1.startRemoteProxies)(staticRemotesConfig, mappedLocationsOfStaticRemotes, options.ssl
|
|
76
|
-
? {
|
|
77
|
-
pathToCert: options.sslCert,
|
|
78
|
-
pathToKey: options.sslKey,
|
|
79
|
-
}
|
|
80
|
-
: undefined);
|
|
56
|
+
const { remotes, staticRemotesIter, devRemoteIters } = await (0, utils_1.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'angular');
|
|
81
57
|
const removeBaseUrlEmission = (iter) => (0, async_iterable_1.mapAsyncIterable)(iter, (v) => ({
|
|
82
58
|
...v,
|
|
83
59
|
baseUrl: undefined,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Schema } from '../schema';
|
|
2
|
-
export declare function normalizeOptions(options: Schema):
|
|
1
|
+
import type { NormalizedSchema, Schema } from '../schema';
|
|
2
|
+
export declare function normalizeOptions(options: Schema): NormalizedSchema;
|
|
@@ -12,6 +12,7 @@ function normalizeOptions(options) {
|
|
|
12
12
|
return {
|
|
13
13
|
...options,
|
|
14
14
|
devRemotes: devServeRemotes,
|
|
15
|
+
verbose: options.verbose ?? false,
|
|
15
16
|
ssl: options.ssl ?? false,
|
|
16
17
|
sslCert: options.sslCert ? (0, path_1.join)(devkit_1.workspaceRoot, options.sslCert) : undefined,
|
|
17
18
|
sslKey: options.sslKey ? (0, path_1.join)(devkit_1.workspaceRoot, options.sslKey) : undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Schema } from '../schema';
|
|
2
2
|
import { type ExecutorContext, type ProjectConfiguration } from '@nx/devkit';
|
|
3
|
-
export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Schema, context: ExecutorContext): Promise<AsyncIterable<{
|
|
3
|
+
export declare function startRemotes(remotes: string[], workspaceProjects: Record<string, ProjectConfiguration>, options: Pick<Schema, 'devRemotes' | 'verbose'>, context: ExecutorContext): Promise<AsyncIterable<{
|
|
4
4
|
success: boolean;
|
|
5
5
|
}>[]>;
|
package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ExecutorContext } from '@nx/devkit';
|
|
2
2
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function moduleFederationSsrDevServerExecutor(schema: Schema, context: ExecutorContext): AsyncGenerator<
|
|
3
|
+
export declare function moduleFederationSsrDevServerExecutor(schema: Schema, context: ExecutorContext): AsyncGenerator<import("@angular-devkit/build-angular").SSRDevServerBuilderOutput, any, any>;
|
|
4
4
|
export default moduleFederationSsrDevServerExecutor;
|
package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.moduleFederationSsrDevServerExecutor = moduleFederationSsrDevServerExecutor;
|
|
4
|
+
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
7
8
|
const path_1 = require("path");
|
|
8
9
|
const module_federation_1 = require("../../builders/utilities/module-federation");
|
|
9
|
-
const utils_1 = require("@nx/module-federation/src/utils");
|
|
10
|
-
const build_static_remotes_1 = require("./lib/build-static-remotes");
|
|
10
|
+
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
11
11
|
const start_dev_remotes_1 = require("./lib/start-dev-remotes");
|
|
12
|
-
const start_static_remotes_1 = require("./lib/start-static-remotes");
|
|
13
12
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
14
13
|
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
15
14
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
16
15
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
17
16
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
18
|
-
const angular_version_utils_1 = require("../utilities/angular-version-utils");
|
|
19
17
|
async function* moduleFederationSsrDevServerExecutor(schema, context) {
|
|
20
|
-
const nxBin = require.resolve('nx/bin/nx');
|
|
21
18
|
const options = (0, normalize_options_1.normalizeOptions)(schema);
|
|
22
|
-
const
|
|
23
|
-
const { executeSSRDevServerBuilder } = angularMajorVersion >= 17
|
|
24
|
-
? require('@angular-devkit/build-angular')
|
|
25
|
-
: require('@nguniversal/builders');
|
|
26
|
-
const currIter = (0, rxjs_for_await_1.eachValueFrom)(executeSSRDevServerBuilder(options, await (0, ngcli_adapter_1.createBuilderContext)({
|
|
19
|
+
const currIter = (0, rxjs_for_await_1.eachValueFrom)((0, build_angular_1.executeSSRDevServerBuilder)(options, await (0, ngcli_adapter_1.createBuilderContext)({
|
|
27
20
|
builderName: '@nx/angular:webpack-server',
|
|
28
21
|
description: 'Build a ssr application',
|
|
29
22
|
optionSchema: require('../../builders/webpack-server/schema.json'),
|
|
@@ -48,31 +41,12 @@ async function* moduleFederationSsrDevServerExecutor(schema, context) {
|
|
|
48
41
|
pathToManifestFile = (0, module_federation_1.getDynamicMfManifestFile)(project, context.root);
|
|
49
42
|
}
|
|
50
43
|
(0, module_federation_1.validateDevRemotes)({ devRemotes: options.devRemotes }, workspaceProjects);
|
|
51
|
-
const
|
|
52
|
-
const remoteNames = options.devRemotes.map((r) => typeof r === 'string' ? r : r.remoteName);
|
|
53
|
-
const remotes = (0, utils_1.getRemotes)(remoteNames, options.skipRemotes, moduleFederationConfig, {
|
|
54
|
-
projectName: project.name,
|
|
55
|
-
projectGraph: context.projectGraph,
|
|
56
|
-
root: context.root,
|
|
57
|
-
}, pathToManifestFile);
|
|
58
|
-
options.staticRemotesPort ??= remotes.staticRemotePort;
|
|
59
|
-
const staticRemotesConfig = (0, utils_1.parseStaticSsrRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
60
|
-
const mappedLocationsOfStaticRemotes = await (0, build_static_remotes_1.buildStaticRemotes)(staticRemotesConfig, nxBin, context, options);
|
|
61
|
-
// Set NX_MF_DEV_REMOTES for the Nx Runtime Library Control Plugin
|
|
62
|
-
process.env.NX_MF_DEV_REMOTES = JSON.stringify([
|
|
63
|
-
...(options.devRemotes.map((r) => typeof r === 'string' ? r : r.remoteName) ?? []).map((r) => r.replace(/-/g, '_')),
|
|
64
|
-
project.name.replace(/-/g, '_'),
|
|
65
|
-
]);
|
|
66
|
-
const devRemotes = await (0, start_dev_remotes_1.startRemotes)(remotes.devRemotes, workspaceProjects, options, context);
|
|
67
|
-
const staticRemotes = (0, start_static_remotes_1.startStaticRemotes)(staticRemotesConfig, context, options);
|
|
68
|
-
(0, utils_1.startSsrRemoteProxies)(staticRemotesConfig, mappedLocationsOfStaticRemotes, options.ssl
|
|
69
|
-
? { pathToCert: options.sslCert, pathToKey: options.sslKey }
|
|
70
|
-
: undefined);
|
|
44
|
+
const { remotes, staticRemotesIter, devRemoteIters } = await (0, utils_1.startRemoteIterators)(options, context, start_dev_remotes_1.startRemotes, pathToManifestFile, 'angular', true);
|
|
71
45
|
const removeBaseUrlEmission = (iter) => (0, async_iterable_1.mapAsyncIterable)(iter, (v) => ({
|
|
72
46
|
...v,
|
|
73
47
|
baseUrl: undefined,
|
|
74
48
|
}));
|
|
75
|
-
const combined = (0, async_iterable_1.combineAsyncIterables)(removeBaseUrlEmission(
|
|
49
|
+
const combined = (0, async_iterable_1.combineAsyncIterables)(removeBaseUrlEmission(staticRemotesIter), ...(devRemoteIters ? devRemoteIters.map(removeBaseUrlEmission) : []), (0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
|
|
76
50
|
if (!options.isInitialHost) {
|
|
77
51
|
done();
|
|
78
52
|
return;
|
|
@@ -84,7 +58,7 @@ async function* moduleFederationSsrDevServerExecutor(schema, context) {
|
|
|
84
58
|
return;
|
|
85
59
|
}
|
|
86
60
|
try {
|
|
87
|
-
const portsToWaitFor =
|
|
61
|
+
const portsToWaitFor = staticRemotesIter
|
|
88
62
|
? [options.staticRemotesPort, ...remotes.remotePorts]
|
|
89
63
|
: [...remotes.remotePorts];
|
|
90
64
|
await Promise.all(portsToWaitFor.map((port) => (0, wait_for_port_open_1.waitForPortOpen)(port, {
|
|
@@ -103,7 +77,7 @@ async function* moduleFederationSsrDevServerExecutor(schema, context) {
|
|
|
103
77
|
done();
|
|
104
78
|
}
|
|
105
79
|
}));
|
|
106
|
-
let refs = 2 + (
|
|
80
|
+
let refs = 2 + (devRemoteIters?.length ?? 0);
|
|
107
81
|
for await (const result of combined) {
|
|
108
82
|
if (result.success === false)
|
|
109
83
|
throw new Error('Remotes failed to start');
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { type DevRemoteDefinition } from '../../builders/utilities/module-federation';
|
|
2
|
+
import type { SSRDevServerBuilderOptions } from '@angular-devkit/build-angular';
|
|
2
3
|
|
|
3
|
-
export interface Schema {
|
|
4
|
-
browserTarget: string;
|
|
5
|
-
serverTarget: string;
|
|
6
|
-
host?: string;
|
|
7
|
-
port?: number;
|
|
8
|
-
progress: boolean;
|
|
9
|
-
open?: boolean;
|
|
10
|
-
publicHost?: string;
|
|
11
|
-
ssl?: boolean;
|
|
12
|
-
sslKey?: string;
|
|
13
|
-
sslCert?: string;
|
|
14
|
-
proxyConfig?: string;
|
|
4
|
+
export interface Schema extends SSRDevServerBuilderOptions {
|
|
15
5
|
devRemotes?: DevRemoteDefinition[];
|
|
16
6
|
skipRemotes?: string[];
|
|
17
|
-
verbose: boolean;
|
|
18
7
|
pathToManifestFile?: string;
|
|
19
8
|
parallel?: number;
|
|
20
9
|
staticRemotesPort?: number;
|
|
21
|
-
parallel?: number;
|
|
22
10
|
isInitialHost?: boolean;
|
|
23
11
|
}
|
|
12
|
+
|
|
13
|
+
export interface NormalizedSchema extends Schema {
|
|
14
|
+
devRemotes: DevRemoteDefinition[];
|
|
15
|
+
ssl: boolean;
|
|
16
|
+
verbose: boolean;
|
|
17
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { NgPackagr } from 'ng-packagr';
|
|
2
|
-
|
|
3
|
-
export declare function getNgPackagrInstance(options: BuildAngularLibraryExecutorOptions): Promise<NgPackagr>;
|
|
2
|
+
export declare function getNgPackagrInstance(): Promise<NgPackagr>;
|
|
@@ -3,31 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getNgPackagrInstance = getNgPackagrInstance;
|
|
4
4
|
const ng_packagr_1 = require("ng-packagr");
|
|
5
5
|
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
6
|
-
async function getNgPackagrInstance(
|
|
6
|
+
async function getNgPackagrInstance() {
|
|
7
7
|
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
8
|
-
if (angularMajorVersion >=
|
|
9
|
-
const { WRITE_BUNDLES_TRANSFORM } = await import('./v17+/ng-package/entry-point/write-bundles.di.js');
|
|
10
|
-
const { WRITE_PACKAGE_TRANSFORM } = await import('./v17+/ng-package/entry-point/write-package.di.js');
|
|
8
|
+
if (angularMajorVersion >= 19) {
|
|
11
9
|
const { STYLESHEET_PROCESSOR } = await import('../../utilities/ng-packagr/stylesheet-processor.di.js');
|
|
12
10
|
const packagr = (0, ng_packagr_1.ngPackagr)();
|
|
13
|
-
packagr.withProviders([
|
|
14
|
-
WRITE_BUNDLES_TRANSFORM,
|
|
15
|
-
WRITE_PACKAGE_TRANSFORM,
|
|
16
|
-
STYLESHEET_PROCESSOR,
|
|
17
|
-
]);
|
|
11
|
+
packagr.withProviders([STYLESHEET_PROCESSOR]);
|
|
18
12
|
return packagr;
|
|
19
13
|
}
|
|
20
|
-
const {
|
|
21
|
-
const {
|
|
22
|
-
const {
|
|
23
|
-
const packagr =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
watch: options.watch,
|
|
29
|
-
}),
|
|
14
|
+
const { WRITE_BUNDLES_TRANSFORM } = await import('./pre-v19/ng-package/entry-point/write-bundles.di.js');
|
|
15
|
+
const { WRITE_PACKAGE_TRANSFORM } = await import('./pre-v19/ng-package/entry-point/write-package.di.js');
|
|
16
|
+
const { STYLESHEET_PROCESSOR } = await import('../../utilities/ng-packagr/stylesheet-processor.di.js');
|
|
17
|
+
const packagr = (0, ng_packagr_1.ngPackagr)();
|
|
18
|
+
packagr.withProviders([
|
|
19
|
+
WRITE_BUNDLES_TRANSFORM,
|
|
20
|
+
WRITE_PACKAGE_TRANSFORM,
|
|
21
|
+
STYLESHEET_PROCESSOR,
|
|
30
22
|
]);
|
|
31
|
-
packagr.withBuildTransform(NX_PACKAGE_TRANSFORM.provide);
|
|
32
23
|
return packagr;
|
|
33
24
|
}
|
|
@@ -2,5 +2,5 @@ import type { ExecutorContext } from '@nx/devkit';
|
|
|
2
2
|
import type { BuildAngularLibraryExecutorOptions } from '../package/schema';
|
|
3
3
|
export declare const ngPackagrLiteExecutor: (options: BuildAngularLibraryExecutorOptions, context: ExecutorContext) => AsyncGenerator<{
|
|
4
4
|
success: boolean;
|
|
5
|
-
}, any,
|
|
5
|
+
}, any, any>;
|
|
6
6
|
export default ngPackagrLiteExecutor;
|
|
@@ -7,7 +7,7 @@ const package_impl_1 = require("../package/package.impl");
|
|
|
7
7
|
const typescript_1 = require("../utilities/typescript");
|
|
8
8
|
const ng_packagr_1 = require("./ng-packagr-adjustments/ng-packagr");
|
|
9
9
|
async function initializeNgPackgrLite(options, context, projectDependencies) {
|
|
10
|
-
const ngPackagr = await (0, ng_packagr_1.getNgPackagrInstance)(
|
|
10
|
+
const ngPackagr = await (0, ng_packagr_1.getNgPackagrInstance)();
|
|
11
11
|
ngPackagr.forProject((0, path_1.resolve)(context.root, options.project));
|
|
12
12
|
if (options.tsConfig) {
|
|
13
13
|
const remappedTsConfigFilePath = (0, buildable_libs_utils_1.createTmpTsConfig)((0, path_1.join)(context.root, options.tsConfig), context.root, context.projectsConfigurations.projects[context.projectName].root, projectDependencies);
|
|
@@ -7,10 +7,6 @@
|
|
|
7
7
|
"cli": "nx",
|
|
8
8
|
"type": "object",
|
|
9
9
|
"presets": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Buildable Library with Tailwind",
|
|
12
|
-
"keys": ["project", "tailwindConfig"]
|
|
13
|
-
},
|
|
14
10
|
{
|
|
15
11
|
"name": "Updating Project Dependencies for Buildable Library",
|
|
16
12
|
"keys": ["project"]
|
|
@@ -36,10 +32,6 @@
|
|
|
36
32
|
"poll": {
|
|
37
33
|
"type": "number",
|
|
38
34
|
"description": "Enable and define the file watching poll time period in milliseconds. _Note: this is only supported in Angular versions >= 18.0.0_."
|
|
39
|
-
},
|
|
40
|
-
"tailwindConfig": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"description": "The full path for the Tailwind configuration file, relative to the workspace root. If not provided and a `tailwind.config.js` file exists in the project or workspace root, it will be used. Otherwise, Tailwind will not be configured."
|
|
43
35
|
}
|
|
44
36
|
},
|
|
45
37
|
"additionalProperties": false,
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import { NgPackagr } from 'ng-packagr';
|
|
2
|
-
|
|
3
|
-
export declare function getNgPackagrInstance(options: BuildAngularLibraryExecutorOptions): Promise<NgPackagr>;
|
|
2
|
+
export declare function getNgPackagrInstance(): Promise<NgPackagr>;
|
|
@@ -2,26 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNgPackagrInstance = getNgPackagrInstance;
|
|
4
4
|
const ng_packagr_1 = require("ng-packagr");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const { STYLESHEET_PROCESSOR } = await import('../../utilities/ng-packagr/stylesheet-processor.di.js');
|
|
10
|
-
const packagr = (0, ng_packagr_1.ngPackagr)();
|
|
11
|
-
packagr.withProviders([STYLESHEET_PROCESSOR]);
|
|
12
|
-
return packagr;
|
|
13
|
-
}
|
|
14
|
-
const { NX_ENTRY_POINT_PROVIDERS } = await import('./ng-package/entry-point/entry-point.di.js');
|
|
15
|
-
const { nxProvideOptions } = await import('./ng-package/options.di.js');
|
|
16
|
-
const { NX_PACKAGE_PROVIDERS, NX_PACKAGE_TRANSFORM } = await import('./ng-package/package.di.js');
|
|
17
|
-
const packagr = new ng_packagr_1.NgPackagr([
|
|
18
|
-
...NX_PACKAGE_PROVIDERS,
|
|
19
|
-
...NX_ENTRY_POINT_PROVIDERS,
|
|
20
|
-
nxProvideOptions({
|
|
21
|
-
tailwindConfig: options.tailwindConfig,
|
|
22
|
-
watch: options.watch,
|
|
23
|
-
}),
|
|
24
|
-
]);
|
|
25
|
-
packagr.withBuildTransform(NX_PACKAGE_TRANSFORM.provide);
|
|
5
|
+
async function getNgPackagrInstance() {
|
|
6
|
+
const { STYLESHEET_PROCESSOR } = await import('../../utilities/ng-packagr/stylesheet-processor.di.js');
|
|
7
|
+
const packagr = (0, ng_packagr_1.ngPackagr)();
|
|
8
|
+
packagr.withProviders([STYLESHEET_PROCESSOR]);
|
|
26
9
|
return packagr;
|
|
27
10
|
}
|