@nx/angular 21.1.1 → 21.2.0-beta.1
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/README.md +3 -3
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/index.d.ts +2 -1
- package/mf/index.d.ts +71 -1
- package/migrations.json +106 -0
- package/ng-package.json +0 -1
- package/package.json +28 -16
- package/plugins/component-testing.js +8 -3
- package/src/builders/dev-server/dev-server.impl.js +4 -7
- package/src/builders/dev-server/lib/normalize-options.js +0 -6
- package/src/builders/dev-server/lib/validate-options.js +0 -4
- package/src/builders/dev-server/schema.d.ts +3 -15
- package/src/builders/dev-server/schema.json +3 -9
- package/src/builders/webpack-browser/webpack-browser.impl.js +2 -0
- package/src/builders/webpack-server/webpack-server.impl.d.ts +3 -1
- package/src/builders/webpack-server/webpack-server.impl.js +2 -0
- package/src/executors/application/application.impl.d.ts +2 -2
- package/src/executors/application/application.impl.js +11 -6
- package/src/executors/application/schema.d.ts +1 -1
- package/src/executors/application/schema.json +21 -10
- package/src/executors/application/utils/normalize-options.js +8 -1
- package/src/executors/application/utils/validate-options.js +10 -40
- package/src/executors/extract-i18n/extract-i18n.impl.js +6 -14
- package/src/executors/extract-i18n/schema.d.ts +1 -6
- package/src/executors/extract-i18n/schema.json +5 -0
- package/src/executors/extract-i18n/utils/validate-options.d.ts +2 -0
- package/src/executors/extract-i18n/utils/validate-options.js +13 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +1 -7
- package/src/executors/module-federation-dev-server/schema.d.ts +3 -15
- package/src/executors/module-federation-dev-server/schema.json +2 -15
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +10 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts +6 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js +46 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.d.ts +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.js +3 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.d.ts +2 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +22 -6
- package/src/executors/ng-packagr-lite/schema.json +2 -3
- package/src/executors/package/package.impl.js +1 -5
- package/src/executors/package/schema.d.ts +3 -1
- package/src/executors/package/schema.json +2 -3
- package/src/executors/utilities/builder-package.d.ts +1 -0
- package/src/executors/utilities/builder-package.js +11 -0
- package/src/executors/utilities/esbuild-extensions.d.ts +2 -1
- package/src/executors/utilities/ng-packagr/package-imports.d.ts +3 -1
- package/src/executors/utilities/ng-packagr/package-imports.js +2 -2
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +2 -24
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +40 -107
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +4 -8
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts +1 -1
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +18 -11
- package/src/generators/add-linting/add-linting.js +8 -0
- package/src/generators/application/application.js +22 -8
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +10 -1
- package/src/generators/application/files/base/tsconfig.json__tpl__ +5 -6
- package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +28 -0
- package/src/generators/application/files/ng-module/src/app/{app.component.ts__tpl__ → app__componentFileSuffix__.ts__tpl__} +4 -4
- package/src/generators/application/files/ng-module/src/app/app__moduleTypeSeparator__module.ts__tpl__ +17 -0
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +11 -3
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/{nx-welcome.component.ts__tpl__ → nx-welcome__componentFileSuffix__.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/{nx-welcome.component.ts__tpl__ → nx-welcome__componentFileSuffix__.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/{nx-welcome.component.ts__tpl__ → nx-welcome__componentFileSuffix__.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/{nx-welcome.component.ts__tpl__ → nx-welcome__componentFileSuffix__.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/{nx-welcome.component.ts__tpl__ → nx-welcome__componentFileSuffix__.ts__tpl__} +1 -1
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/{nx-welcome.component.ts__tpl__ → nx-welcome__componentFileSuffix__.ts__tpl__} +1 -1
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +6 -2
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +27 -0
- package/src/generators/application/files/standalone-components/src/app/{app.component.ts__tpl__ → app__componentFileSuffix__.ts__tpl__} +6 -6
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +2 -2
- package/src/generators/application/lib/create-files.d.ts +1 -1
- package/src/generators/application/lib/create-files.js +18 -19
- package/src/generators/application/lib/create-project.d.ts +1 -1
- package/src/generators/application/lib/create-project.js +119 -26
- package/src/generators/application/lib/enable-strict-type-checking.js +4 -2
- package/src/generators/application/lib/index.d.ts +1 -2
- package/src/generators/application/lib/index.js +1 -2
- package/src/generators/application/lib/set-generator-defaults.js +1 -0
- package/src/generators/application/lib/{update-editor-tsconfig.d.ts → update-tsconfig-files.d.ts} +1 -1
- package/src/generators/application/lib/update-tsconfig-files.js +76 -0
- package/src/generators/application/schema.json +1 -1
- package/src/generators/component/component.js +13 -2
- package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/component/lib/component.js +11 -1
- package/src/generators/component/lib/module.d.ts +7 -2
- package/src/generators/component/lib/module.js +7 -5
- package/src/generators/component/lib/normalize-options.js +7 -3
- package/src/generators/component/schema.d.ts +1 -0
- package/src/generators/component/schema.json +6 -2
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +37 -24
- package/src/generators/convert-to-rspack/convert-to-rspack.js +2 -6
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +1 -1
- package/src/generators/directive/directive.js +1 -1
- package/src/generators/directive/lib/normalize-options.js +7 -2
- package/src/generators/directive/schema.d.ts +1 -0
- package/src/generators/directive/schema.json +10 -2
- package/src/generators/host/host.js +21 -1
- package/src/generators/host/schema.d.ts +1 -0
- package/src/generators/host/schema.json +7 -1
- package/src/generators/init/init.js +1 -1
- package/src/generators/library/files/base/tsconfig.json__tpl__ +5 -5
- package/src/generators/library/files/ng-module/src/index.ts__tpl__ +1 -1
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +2 -2
- package/src/generators/library/lib/add-standalone-component.js +1 -0
- package/src/generators/library/lib/create-files.js +10 -3
- package/src/generators/library/lib/normalize-options.d.ts +3 -3
- package/src/generators/library/lib/normalize-options.js +6 -1
- package/src/generators/library/lib/normalized-schema.d.ts +2 -0
- package/src/generators/library/lib/set-generator-defaults.js +1 -0
- package/src/generators/library/lib/update-tsconfig-files.d.ts +3 -0
- package/src/generators/library/lib/update-tsconfig-files.js +85 -0
- package/src/generators/library/library.js +19 -33
- package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +1 -1
- package/src/generators/library-secondary-entry-point/lib/add-files.js +2 -1
- package/src/generators/library-secondary-entry-point/lib/normalize-options.d.ts +2 -2
- package/src/generators/library-secondary-entry-point/lib/normalize-options.js +3 -0
- package/src/generators/library-secondary-entry-point/schema.d.ts +1 -0
- package/src/generators/move/lib/update-module-name.js +17 -10
- package/src/generators/move/lib/update-secondary-entry-points.js +0 -3
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +43 -8
- package/src/generators/ngrx/schema.json +3 -3
- package/src/generators/ngrx-root-store/lib/normalize-options.js +9 -2
- package/src/generators/pipe/lib/normalize-options.js +4 -0
- package/src/generators/pipe/pipe.js +1 -1
- package/src/generators/pipe/schema.d.ts +1 -0
- package/src/generators/pipe/schema.json +11 -2
- package/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +4 -4
- package/src/generators/remote/lib/update-ssr-setup.js +5 -0
- package/src/generators/remote/remote.js +23 -0
- package/src/generators/remote/schema.d.ts +1 -0
- package/src/generators/remote/schema.json +7 -1
- package/src/generators/scam/lib/convert-component-to-scam.js +1 -3
- package/src/generators/scam/lib/normalize-options.js +11 -3
- package/src/generators/scam/schema.d.ts +1 -0
- package/src/generators/scam/schema.json +1 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +1 -3
- package/src/generators/scam-directive/lib/normalize-options.js +11 -2
- package/src/generators/scam-directive/schema.d.ts +2 -0
- package/src/generators/scam-directive/schema.json +10 -2
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +1 -3
- package/src/generators/scam-pipe/lib/normalize-options.js +8 -0
- package/src/generators/scam-pipe/schema.d.ts +2 -0
- package/src/generators/scam-pipe/schema.json +5 -0
- package/src/generators/setup-mf/files/entry-module-files/{entry.module.ts__tmpl__ → __entryModuleFileName__.ts__tmpl__} +4 -4
- package/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/entry-module-files/{entry.component.ts__tmpl__ → entry__componentFileSuffix__.ts__tmpl__} +1 -1
- package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +43 -0
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/standalone-entry-component-files/{entry.component.ts__tmpl__ → entry__componentFileSuffix__.ts__tmpl__} +3 -3
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +1 -1
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.d.ts +2 -2
- package/src/generators/setup-mf/lib/add-remote-entry.js +9 -3
- package/src/generators/setup-mf/lib/add-remote-to-host.js +11 -1
- package/src/generators/setup-mf/lib/fix-bootstrap.d.ts +2 -2
- package/src/generators/setup-mf/lib/fix-bootstrap.js +4 -4
- package/src/generators/setup-mf/lib/generate-config.d.ts +2 -2
- package/src/generators/setup-mf/lib/generate-config.js +1 -0
- package/src/generators/setup-mf/lib/normalize-options.d.ts +1 -1
- package/src/generators/setup-mf/lib/normalize-options.js +13 -0
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +2 -2
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +18 -14
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +1 -5
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +2 -2
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.js +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.d.ts +2 -2
- package/src/generators/setup-mf/lib/update-host-app-routes.js +12 -9
- package/src/generators/setup-mf/lib/update-tsconfig.d.ts +2 -2
- package/src/generators/setup-mf/lib/update-tsconfig.js +5 -5
- package/src/generators/setup-mf/schema.d.ts +7 -0
- package/src/generators/setup-mf/setup-mf.d.ts +2 -2
- package/src/generators/setup-mf/setup-mf.js +16 -6
- package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/__main__ +1 -0
- package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/app/__rootModuleFileName__ +12 -0
- package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +8 -0
- package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +66 -0
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/__main__ +7 -0
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +12 -0
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +8 -0
- package/src/generators/setup-ssr/files/v20+/server-builder/ngmodule-src/__main__ +1 -0
- package/src/generators/setup-ssr/files/v20+/server-builder/ngmodule-src/app/__rootModuleFileName__ +14 -0
- package/src/generators/setup-ssr/files/v20+/server-builder/root/tsconfig.server.json.template +18 -0
- package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +69 -0
- package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/__main__ +7 -0
- package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/app/app.config.server.ts.template +11 -0
- package/src/generators/setup-ssr/lib/add-dependencies.js +11 -8
- package/src/generators/setup-ssr/lib/add-hydration.js +10 -3
- package/src/generators/setup-ssr/lib/add-server-file.js +7 -2
- package/src/generators/setup-ssr/lib/generate-files.js +17 -4
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +32 -6
- package/src/generators/setup-ssr/lib/normalize-options.js +5 -3
- package/src/generators/setup-ssr/lib/update-project-config.js +5 -0
- package/src/generators/setup-ssr/lib/validate-options.js +2 -2
- package/src/generators/setup-ssr/schema.d.ts +1 -0
- package/src/generators/setup-ssr/schema.json +1 -1
- package/src/generators/utils/add-jest.js +6 -1
- package/src/generators/utils/app-components-info.d.ts +9 -0
- package/src/generators/utils/app-components-info.js +39 -0
- package/src/generators/utils/artifact-types.d.ts +3 -0
- package/src/generators/utils/artifact-types.js +33 -0
- package/src/generators/utils/assert-mf-utils.d.ts +1 -0
- package/src/generators/utils/assert-mf-utils.js +11 -0
- package/src/generators/utils/ensure-angular-dependencies.js +6 -3
- package/src/generators/utils/export-scam.d.ts +1 -0
- package/src/generators/utils/export-scam.js +1 -2
- package/src/generators/utils/find-module.js +18 -13
- package/src/generators/utils/storybook-ast/component-info.js +40 -24
- package/src/generators/utils/storybook-ast/module-info.d.ts +1 -1
- package/src/generators/utils/storybook-ast/module-info.js +3 -8
- package/src/generators/utils/testing.js +28 -28
- package/src/generators/utils/version-utils.js +2 -2
- package/src/generators/web-worker/lib/add-snippet.js +3 -3
- package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.d.ts +2 -0
- package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.js +110 -0
- package/src/migrations/update-21-2-0/replace-provide-server-routing.d.ts +2 -0
- package/src/migrations/update-21-2-0/replace-provide-server-routing.js +103 -0
- package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.d.ts +2 -0
- package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.js +47 -0
- package/src/migrations/update-21-2-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-21-2-0/update-angular-cli.js +23 -0
- package/src/migrations/update-21-2-0/update-module-resolution.d.ts +2 -0
- package/src/migrations/update-21-2-0/update-module-resolution.js +45 -0
- package/src/plugins/plugin.js +22 -13
- package/src/utils/backward-compatible-versions.d.ts +2 -2
- package/src/utils/backward-compatible-versions.js +22 -19
- package/src/utils/nx-devkit/ast-utils.js +17 -3
- package/src/utils/nx-devkit/testing.js +9 -9
- package/src/utils/targets.d.ts +2 -1
- package/src/utils/targets.js +6 -0
- package/src/utils/versions.d.ts +4 -3
- package/src/utils/versions.js +5 -4
- package/mf/mf.d.ts +0 -69
- package/src/generators/application/files/base-pre18/src/favicon.ico +0 -0
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +0 -29
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +0 -17
- package/src/generators/application/files/standalone-components/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +0 -28
- package/src/generators/application/lib/set-app-strict-default.d.ts +0 -2
- package/src/generators/application/lib/set-app-strict-default.js +0 -13
- package/src/generators/application/lib/update-editor-tsconfig.js +0 -21
- package/src/generators/library/lib/enable-strict-type-checking.d.ts +0 -7
- package/src/generators/library/lib/enable-strict-type-checking.js +0 -47
- package/src/generators/library/lib/update-tsconfig.d.ts +0 -3
- package/src/generators/library/lib/update-tsconfig.js +0 -36
- package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +0 -47
- /package/src/generators/application/files/{base-18+ → base}/public/favicon.ico +0 -0
- /package/src/generators/application/files/{base-pre18/src/assets/.gitkeep__tpl__ → ng-module/src/app/app__componentFileSuffix__.__style__} +0 -0
- /package/src/generators/application/files/ng-module/src/app/{app.component.html__tpl__ → app__componentFileSuffix__.html__tpl__} +0 -0
- /package/src/generators/application/files/{ng-module/src/app/app.component.__style__ → standalone-components/src/app/app__componentFileSuffix__.__style__} +0 -0
- /package/src/generators/application/files/standalone-components/src/app/{app.component.html__tpl__ → app__componentFileSuffix__.html__tpl__} +0 -0
- /package/src/generators/component/files/{__fileName__.html__tpl__ → __fileName____ngext__.html__tpl__} +0 -0
- /package/src/generators/library/files/ng-module/src/lib/{__libFileName__.module.ts__tpl__ → __libFileName____moduleTypeSeparator__module.ts__tpl__} +0 -0
- /package/src/generators/library-secondary-entry-point/files/src/lib/{__fileName__.module.ts__tmpl__ → __fileName____moduleTypeSeparator__module.ts__tmpl__} +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/ngmodule-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/server/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/standalone-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/application-builder-common-engine/server/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/server-builder/ngmodule-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/server-builder/root/tsconfig.server.json.template +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/server-builder/server/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/server-builder/standalone-src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{v19+ → v19}/server-builder/standalone-src/app/app.config.server.ts.template +0 -0
@@ -19,7 +19,6 @@
|
|
19
19
|
"description": "The full path for the browser entry point to the application, relative to the current workspace."
|
20
20
|
},
|
21
21
|
"server": {
|
22
|
-
"type": "string",
|
23
22
|
"description": "The full path for the server entry point to the application, relative to the current workspace.",
|
24
23
|
"oneOf": [
|
25
24
|
{
|
@@ -48,7 +47,7 @@
|
|
48
47
|
},
|
49
48
|
"deployUrl": {
|
50
49
|
"type": "string",
|
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.
|
50
|
+
"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."
|
52
51
|
},
|
53
52
|
"security": {
|
54
53
|
"description": "Security features to protect against XSS and other common attacks. _Note: this is only supported in Angular versions >= 19.0.0_.",
|
@@ -206,7 +205,7 @@
|
|
206
205
|
"clearScreen": {
|
207
206
|
"type": "boolean",
|
208
207
|
"default": false,
|
209
|
-
"description": "Automatically clear the terminal screen during rebuilds.
|
208
|
+
"description": "Automatically clear the terminal screen during rebuilds."
|
210
209
|
},
|
211
210
|
"optimization": {
|
212
211
|
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
@@ -239,7 +238,7 @@
|
|
239
238
|
},
|
240
239
|
"removeSpecialComments": {
|
241
240
|
"type": "boolean",
|
242
|
-
"description": "Remove comments in global CSS that contains '@license' or '@preserve' or that starts with '//!' or '/*!'.
|
241
|
+
"description": "Remove comments in global CSS that contains '@license' or '@preserve' or that starts with '//!' or '/*!'.",
|
243
242
|
"default": true
|
244
243
|
}
|
245
244
|
},
|
@@ -279,19 +278,26 @@
|
|
279
278
|
]
|
280
279
|
},
|
281
280
|
"loader": {
|
282
|
-
"description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.
|
281
|
+
"description": "Defines the type of loader to use with a specified file extension when used with a JavaScript `import`. `text` inlines the content as a string; `binary` inlines the content as a Uint8Array; `file` emits the file and provides the runtime location of the file; `empty` considers the content to be empty and not include it in bundles.",
|
283
282
|
"type": "object",
|
284
283
|
"patternProperties": {
|
285
284
|
"^\\.\\S+$": { "enum": ["text", "binary", "file", "empty"] }
|
286
285
|
}
|
287
286
|
},
|
288
287
|
"define": {
|
289
|
-
"description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.
|
288
|
+
"description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced.",
|
290
289
|
"type": "object",
|
291
290
|
"additionalProperties": {
|
292
291
|
"type": "string"
|
293
292
|
}
|
294
293
|
},
|
294
|
+
"conditions": {
|
295
|
+
"description": "Custom package resolution conditions used to resolve conditional exports/imports. Defaults to ['module', 'development'/'production']. The following special conditions are always present if the requirements are satisfied: 'default', 'import', 'require', 'browser', 'node'. _Note: this is only supported in Angular versions >= 20.0.0_.",
|
296
|
+
"type": "array",
|
297
|
+
"items": {
|
298
|
+
"type": "string"
|
299
|
+
}
|
300
|
+
},
|
295
301
|
"fileReplacements": {
|
296
302
|
"description": "Replace compilation source files with other compilation source files in the build.",
|
297
303
|
"type": "array",
|
@@ -301,7 +307,7 @@
|
|
301
307
|
"default": []
|
302
308
|
},
|
303
309
|
"outputPath": {
|
304
|
-
"description": "Specify the output path relative to workspace root.
|
310
|
+
"description": "Specify the output path relative to workspace root.",
|
305
311
|
"oneOf": [
|
306
312
|
{
|
307
313
|
"type": "object",
|
@@ -368,6 +374,11 @@
|
|
368
374
|
"type": "boolean",
|
369
375
|
"description": "Resolve vendor packages source maps.",
|
370
376
|
"default": false
|
377
|
+
},
|
378
|
+
"sourcesContent": {
|
379
|
+
"type": "boolean",
|
380
|
+
"description": "Output original source content for files within the source map. _Note: this is only supported in Angular versions >= 20.0.0_.",
|
381
|
+
"default": true
|
371
382
|
}
|
372
383
|
},
|
373
384
|
"additionalProperties": false
|
@@ -500,7 +511,7 @@
|
|
500
511
|
"preloadInitial": {
|
501
512
|
"type": "boolean",
|
502
513
|
"default": true,
|
503
|
-
"description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources.
|
514
|
+
"description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources."
|
504
515
|
}
|
505
516
|
},
|
506
517
|
"required": ["input"]
|
@@ -636,12 +647,12 @@
|
|
636
647
|
}
|
637
648
|
},
|
638
649
|
"indexHtmlTransformer": {
|
639
|
-
"description": "Path to a file exposing a default function to transform the `index.html` file.
|
650
|
+
"description": "Path to a file exposing a default function to transform the `index.html` file.",
|
640
651
|
"type": "string"
|
641
652
|
}
|
642
653
|
},
|
643
654
|
"additionalProperties": false,
|
644
|
-
"required": ["outputPath", "
|
655
|
+
"required": ["outputPath", "tsConfig"],
|
645
656
|
"definitions": {
|
646
657
|
"assetPattern": {
|
647
658
|
"oneOf": [
|
@@ -30,5 +30,12 @@ function normalizeOptions(options) {
|
|
30
30
|
appShell ??= false;
|
31
31
|
prerender ??= false;
|
32
32
|
}
|
33
|
-
|
33
|
+
let sourceMap = options.sourceMap;
|
34
|
+
if (sourceMap &&
|
35
|
+
typeof sourceMap === 'object' &&
|
36
|
+
sourceMap.sourcesContent !== undefined &&
|
37
|
+
angularMajorVersion < 20) {
|
38
|
+
delete sourceMap.sourcesContent;
|
39
|
+
}
|
40
|
+
return { ...options, appShell, prerender, security, sourceMap };
|
34
41
|
}
|
@@ -5,46 +5,6 @@ const semver_1 = require("semver");
|
|
5
5
|
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
6
6
|
function validateOptions(options) {
|
7
7
|
const { version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
8
|
-
if ((0, semver_1.lt)(angularVersion, '17.1.0')) {
|
9
|
-
if (options.loader) {
|
10
|
-
throw new Error(`The "loader" option requires Angular version 17.1.0 or greater. You are currently using version ${angularVersion}.`);
|
11
|
-
}
|
12
|
-
if (options.indexHtmlTransformer) {
|
13
|
-
throw new Error(`The "indexHtmlTransformer" option requires Angular version 17.1.0 or greater. You are currently using version ${angularVersion}.`);
|
14
|
-
}
|
15
|
-
if (typeof options.index === 'object' &&
|
16
|
-
options.index.preloadInitial !== undefined) {
|
17
|
-
throw new Error(`The "index.preloadInitial" option requires Angular version 17.1.0 or greater. You are currently using version ${angularVersion}.`);
|
18
|
-
}
|
19
|
-
if (options.optimization &&
|
20
|
-
typeof options.optimization !== 'boolean' &&
|
21
|
-
options.optimization.styles &&
|
22
|
-
typeof options.optimization.styles !== 'boolean') {
|
23
|
-
if (options.optimization.styles.removeSpecialComments === false) {
|
24
|
-
throw new Error(`The "optimization.styles.removeSpecialComments" option requires Angular version 17.1.0 or greater. You are currently using version ${angularVersion}.`);
|
25
|
-
}
|
26
|
-
else if (options.optimization.styles.removeSpecialComments === true) {
|
27
|
-
// silently remove the option, as it was the default before 17.1.0
|
28
|
-
delete options.optimization.styles.removeSpecialComments;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
if (typeof options.outputPath === 'object') {
|
32
|
-
throw new Error(`The "outputPath" option as an object requires Angular version 17.1.0 or greater. You are currently using version ${angularVersion}.`);
|
33
|
-
}
|
34
|
-
}
|
35
|
-
if ((0, semver_1.lt)(angularVersion, '17.2.0')) {
|
36
|
-
if (options.define) {
|
37
|
-
throw new Error(`The "define" option requires Angular version 17.2.0 or greater. You are currently using version ${angularVersion}.`);
|
38
|
-
}
|
39
|
-
if (options.clearScreen !== undefined) {
|
40
|
-
throw new Error(`The "clearScreen" option requires Angular version 17.2.0 or greater. You are currently using version ${angularVersion}.`);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
if ((0, semver_1.lt)(angularVersion, '17.3.0')) {
|
44
|
-
if (options.deployUrl) {
|
45
|
-
throw new Error(`The "deployUrl" option requires Angular version 17.3.0 or greater. You are currently using version ${angularVersion}.`);
|
46
|
-
}
|
47
|
-
}
|
48
8
|
if ((0, semver_1.lt)(angularVersion, '19.0.0')) {
|
49
9
|
if (options.outputMode) {
|
50
10
|
throw new Error(`The "outputMode" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
|
@@ -62,4 +22,14 @@ function validateOptions(options) {
|
|
62
22
|
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
23
|
}
|
64
24
|
}
|
25
|
+
if ((0, semver_1.lt)(angularVersion, '20.0.0')) {
|
26
|
+
if (options.sourceMap &&
|
27
|
+
typeof options.sourceMap === 'object' &&
|
28
|
+
options.sourceMap.sourcesContent === false) {
|
29
|
+
throw new Error(`The "sourceMap.sourcesContent" option requires Angular version 20.0.0 or greater. You are currently using version ${angularVersion}.`);
|
30
|
+
}
|
31
|
+
if (options.conditions) {
|
32
|
+
throw new Error(`The "conditions" option requires Angular version 20.0.0 or greater. You are currently using version ${angularVersion}.`);
|
33
|
+
}
|
34
|
+
}
|
65
35
|
}
|
@@ -4,13 +4,14 @@ exports.default = extractI18nExecutor;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
6
6
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
7
|
-
const
|
7
|
+
const builder_package_1 = require("../utilities/builder-package");
|
8
8
|
const patch_builder_context_1 = require("../utilities/patch-builder-context");
|
9
9
|
async function* extractI18nExecutor(options, context) {
|
10
10
|
const parsedBuildTarget = (0, devkit_1.parseTargetString)(options.buildTarget, context);
|
11
|
-
const
|
12
|
-
const buildTarget =
|
11
|
+
const buildTargetProjectConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(parsedBuildTarget.project);
|
12
|
+
const buildTarget = buildTargetProjectConfiguration.targets[parsedBuildTarget.target];
|
13
13
|
const isUsingEsbuildBuilder = [
|
14
|
+
'@angular/build:application',
|
14
15
|
'@angular-devkit/build-angular:application',
|
15
16
|
'@angular-devkit/build-angular:browser-esbuild',
|
16
17
|
'@nx/angular:application',
|
@@ -28,16 +29,7 @@ async function* extractI18nExecutor(options, context) {
|
|
28
29
|
* handle `@nx/angular:*` executors.
|
29
30
|
*/
|
30
31
|
(0, patch_builder_context_1.patchBuilderContext)(builderContext, isUsingEsbuildBuilder, parsedBuildTarget);
|
32
|
+
(0, builder_package_1.assertBuilderPackageIsInstalled)('@angular-devkit/build-angular');
|
31
33
|
const { executeExtractI18nBuilder } = await import('@angular-devkit/build-angular');
|
32
|
-
|
33
|
-
return await executeExtractI18nBuilder(delegateBuilderOptions, builderContext);
|
34
|
-
}
|
35
|
-
function getDelegateBuilderOptions(options) {
|
36
|
-
const delegateBuilderOptions = { ...options };
|
37
|
-
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
38
|
-
if (angularMajorVersion <= 17) {
|
39
|
-
delegateBuilderOptions.browserTarget = delegateBuilderOptions.buildTarget;
|
40
|
-
delete delegateBuilderOptions.buildTarget;
|
41
|
-
}
|
42
|
-
return delegateBuilderOptions;
|
34
|
+
return await executeExtractI18nBuilder(options, builderContext);
|
43
35
|
}
|
@@ -1,8 +1,3 @@
|
|
1
1
|
import type { ExtractI18nBuilderOptions } from '@angular-devkit/build-angular';
|
2
2
|
|
3
|
-
export type ExtractI18nExecutorOptions =
|
4
|
-
ExtractI18nBuilderOptions,
|
5
|
-
'browserTarget'
|
6
|
-
> & {
|
7
|
-
buildTarget: string;
|
8
|
-
};
|
3
|
+
export type ExtractI18nExecutorOptions = ExtractI18nBuilderOptions;
|
@@ -38,6 +38,11 @@
|
|
38
38
|
"outFile": {
|
39
39
|
"type": "string",
|
40
40
|
"description": "Name of the file to output."
|
41
|
+
},
|
42
|
+
"i18nDuplicateTranslation": {
|
43
|
+
"type": "string",
|
44
|
+
"description": "How to handle duplicate translations. _Note: this is only available in Angular 20.0.0 and above._",
|
45
|
+
"enum": ["error", "warning", "ignore"]
|
41
46
|
}
|
42
47
|
},
|
43
48
|
"additionalProperties": false,
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.validateOptions = validateOptions;
|
4
|
+
const semver_1 = require("semver");
|
5
|
+
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
6
|
+
function validateOptions(options) {
|
7
|
+
const { version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
8
|
+
if ((0, semver_1.lt)(angularVersion, '20.0.0')) {
|
9
|
+
if (options.i18nDuplicateTranslation) {
|
10
|
+
throw new Error(`The "i18nDuplicateTranslation" option requires Angular version 20.0.0 or greater. You are currently using version ${angularVersion}.`);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
@@ -4,17 +4,11 @@ exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const path_1 = require("path");
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
6
6
|
function normalizeOptions(schema) {
|
7
|
-
let buildTarget = schema.buildTarget;
|
8
|
-
if (schema.browserTarget) {
|
9
|
-
buildTarget ??= schema.browserTarget;
|
10
|
-
delete schema.browserTarget;
|
11
|
-
}
|
12
7
|
schema.buildLibsFromSource ??= true;
|
13
8
|
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${schema.buildLibsFromSource}`;
|
14
|
-
process.env.NX_BUILD_TARGET = `${buildTarget}`;
|
9
|
+
process.env.NX_BUILD_TARGET = `${schema.buildTarget}`;
|
15
10
|
return {
|
16
11
|
...schema,
|
17
|
-
buildTarget,
|
18
12
|
devRemotes: schema.devRemotes ?? [],
|
19
13
|
host: schema.host ?? 'localhost',
|
20
14
|
port: schema.port ?? 4200,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { DevRemoteDefinition } from '../../builders/utilities/module-federation';
|
2
2
|
|
3
|
-
interface
|
3
|
+
interface Schema {
|
4
|
+
buildTarget: string;
|
4
5
|
port?: number;
|
5
6
|
host?: string;
|
6
7
|
proxyConfig?: string;
|
@@ -28,20 +29,7 @@ interface BaseSchema {
|
|
28
29
|
buildLibsFromSource?: boolean;
|
29
30
|
}
|
30
31
|
|
31
|
-
export type
|
32
|
-
/**
|
33
|
-
* @deprecated Use `buildTarget` instead. It will be removed when Angular v20 is released.
|
34
|
-
*/
|
35
|
-
browserTarget: string;
|
36
|
-
};
|
37
|
-
|
38
|
-
export type SchemaWithBuildTarget = BaseSchema & {
|
39
|
-
buildTarget: string;
|
40
|
-
};
|
41
|
-
|
42
|
-
export type Schema = SchemaWithBrowserTarget | SchemaWithBuildTarget;
|
43
|
-
|
44
|
-
export type NormalizedSchema = SchemaWithBuildTarget & {
|
32
|
+
export type NormalizedSchema = Schema & {
|
45
33
|
devRemotes: DevRemoteDefinition[];
|
46
34
|
liveReload: boolean;
|
47
35
|
open: boolean;
|
@@ -12,12 +12,6 @@
|
|
12
12
|
}
|
13
13
|
],
|
14
14
|
"properties": {
|
15
|
-
"browserTarget": {
|
16
|
-
"type": "string",
|
17
|
-
"description": "A browser builder target to serve in the format of `project:target[:configuration]`.",
|
18
|
-
"pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$",
|
19
|
-
"x-deprecated": "Use 'buildTarget' instead. It will be removed when Angular v20 is released."
|
20
|
-
},
|
21
15
|
"buildTarget": {
|
22
16
|
"type": "string",
|
23
17
|
"description": "A build builder target to serve in the format of `project:target[:configuration]`.",
|
@@ -166,18 +160,11 @@
|
|
166
160
|
},
|
167
161
|
"buildLibsFromSource": {
|
168
162
|
"type": "boolean",
|
169
|
-
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `
|
163
|
+
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `buildTarget` options, or it will default to `true` if it's also not set in the `buildTarget` options.",
|
170
164
|
"x-priority": "important"
|
171
165
|
}
|
172
166
|
},
|
173
167
|
"additionalProperties": false,
|
174
|
-
"
|
175
|
-
{
|
176
|
-
"required": ["buildTarget"]
|
177
|
-
},
|
178
|
-
{
|
179
|
-
"required": ["browserTarget"]
|
180
|
-
}
|
181
|
-
],
|
168
|
+
"required": ["buildTarget"],
|
182
169
|
"examplesFile": "../../../docs/module-federation-dev-server-examples.md"
|
183
170
|
}
|
package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
CHANGED
@@ -1,22 +1,24 @@
|
|
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");
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
5
|
+
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
6
|
+
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
7
|
+
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
8
|
+
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
6
9
|
const fs_1 = require("fs");
|
10
|
+
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
7
11
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
8
12
|
const path_1 = require("path");
|
9
13
|
const module_federation_1 = require("../../builders/utilities/module-federation");
|
10
|
-
const
|
11
|
-
const start_dev_remotes_1 = require("./lib/start-dev-remotes");
|
12
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
13
|
-
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
14
|
-
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
14
|
+
const builder_package_1 = require("../utilities/builder-package");
|
15
15
|
const normalize_options_1 = require("./lib/normalize-options");
|
16
|
-
const
|
16
|
+
const start_dev_remotes_1 = require("./lib/start-dev-remotes");
|
17
17
|
async function* moduleFederationSsrDevServerExecutor(schema, context) {
|
18
18
|
const options = (0, normalize_options_1.normalizeOptions)(schema);
|
19
|
-
|
19
|
+
(0, builder_package_1.assertBuilderPackageIsInstalled)('@angular-devkit/build-angular');
|
20
|
+
const { executeSSRDevServerBuilder } = await import('@angular-devkit/build-angular');
|
21
|
+
const currIter = (0, rxjs_for_await_1.eachValueFrom)(executeSSRDevServerBuilder(options, await (0, ngcli_adapter_1.createBuilderContext)({
|
20
22
|
builderName: '@nx/angular:webpack-server',
|
21
23
|
description: 'Build a ssr application',
|
22
24
|
optionSchema: require('../../builders/webpack-server/schema.json'),
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
-
import type { NgEntryPoint as NgEntryPointBase } from 'ng-packagr/lib/ng-package/entry-point/entry-point';
|
2
|
-
import type { NgPackageConfig } from 'ng-packagr/ng-package.schema';
|
3
|
-
export
|
1
|
+
import type { NgEntryPoint as NgEntryPointBase } from 'ng-packagr/src/lib/ng-package/entry-point/entry-point';
|
2
|
+
import type { NgPackageConfig } from 'ng-packagr/src/ng-package.schema';
|
3
|
+
export type NgEntryPointType = NgEntryPointBase & {
|
4
|
+
primaryDestinationPath?: string;
|
5
|
+
};
|
6
|
+
export declare function createNgEntryPoint(packageJson: Record<string, any>, ngPackageJson: NgPackageConfig, basePath: string, secondaryData?: Record<string, any>): NgEntryPointType;
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js
CHANGED
@@ -6,16 +6,54 @@ const ng_packagr_version_1 = require("../../../../utilities/ng-packagr/ng-packag
|
|
6
6
|
const package_imports_1 = require("../../../../utilities/ng-packagr/package-imports");
|
7
7
|
function createNgEntryPoint(packageJson, ngPackageJson, basePath, secondaryData) {
|
8
8
|
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
9
|
-
const { NgEntryPoint: NgEntryPointBase } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/ng-package/entry-point/entry-point', ngPackagrMajorVersion);
|
9
|
+
const { NgEntryPoint: NgEntryPointBase } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/entry-point/entry-point', ngPackagrMajorVersion);
|
10
|
+
if (ngPackagrMajorVersion < 20) {
|
11
|
+
class NgEntryPoint extends NgEntryPointBase {
|
12
|
+
/**
|
13
|
+
* Point the FESM2022 files to the ESM2022 files.
|
14
|
+
*/
|
15
|
+
get destinationFiles() {
|
16
|
+
const result = super.destinationFiles;
|
17
|
+
result.fesm2022 = result.esm2022;
|
18
|
+
result.fesm2022Dir = (0, node_path_1.dirname)(result.esm2022);
|
19
|
+
return result;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
return new NgEntryPoint(packageJson, ngPackageJson, basePath, secondaryData);
|
23
|
+
}
|
24
|
+
const { ensureUnixPath } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/utils/path', ngPackagrMajorVersion);
|
10
25
|
class NgEntryPoint extends NgEntryPointBase {
|
11
|
-
|
12
|
-
|
13
|
-
|
26
|
+
constructor(packageJson, ngPackageJson, basePath, _secondaryData) {
|
27
|
+
super(packageJson, ngPackageJson, basePath, _secondaryData);
|
28
|
+
this.packageJson = packageJson;
|
29
|
+
this.ngPackageJson = ngPackageJson;
|
30
|
+
this.basePath = basePath;
|
31
|
+
this._secondaryData = _secondaryData;
|
32
|
+
}
|
33
|
+
get primaryDestinationPath() {
|
34
|
+
return (this._secondaryData?.primaryDestinationPath ?? this.destinationPath);
|
35
|
+
}
|
14
36
|
get destinationFiles() {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
37
|
+
let primaryDestPath = this.destinationPath;
|
38
|
+
let secondaryDir = '';
|
39
|
+
if (this._secondaryData) {
|
40
|
+
primaryDestPath = this._secondaryData.primaryDestinationPath;
|
41
|
+
secondaryDir = (0, node_path_1.relative)(primaryDestPath, this._secondaryData.destinationPath);
|
42
|
+
}
|
43
|
+
const flatModuleFile = this.flatModuleFile;
|
44
|
+
const pathJoinWithDest = (...paths) => (0, node_path_1.join)(primaryDestPath, ...paths);
|
45
|
+
return {
|
46
|
+
directory: ensureUnixPath(secondaryDir),
|
47
|
+
declarations: pathJoinWithDest('tmp-typings', secondaryDir, `${flatModuleFile}.d.ts`),
|
48
|
+
// changed to use esm2022
|
49
|
+
declarationsBundled: pathJoinWithDest('esm2022', secondaryDir, `${flatModuleFile}.d.ts`),
|
50
|
+
declarationsDir: pathJoinWithDest(secondaryDir),
|
51
|
+
esm2022: pathJoinWithDest('tmp-esm2022', secondaryDir, `${flatModuleFile}.js`),
|
52
|
+
// changed to use esm2022
|
53
|
+
fesm2022: pathJoinWithDest('esm2022', secondaryDir, `${flatModuleFile}.js`),
|
54
|
+
// changed to use esm2022
|
55
|
+
fesm2022Dir: pathJoinWithDest('esm2022'),
|
56
|
+
};
|
19
57
|
}
|
20
58
|
}
|
21
59
|
return new NgEntryPoint(packageJson, ngPackageJson, basePath, secondaryData);
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
|
1
|
+
import type { TransformProvider } from 'ng-packagr/src/lib/graph/transform.di';
|
2
2
|
export declare function getWriteBundlesTransformProvider(): TransformProvider;
|
@@ -6,9 +6,9 @@ const package_imports_1 = require("../../../../utilities/ng-packagr/package-impo
|
|
6
6
|
const write_bundles_transform_1 = require("./write-bundles.transform");
|
7
7
|
function getWriteBundlesTransformProvider() {
|
8
8
|
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
9
|
-
const { provideTransform } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/graph/transform.di', ngPackagrMajorVersion);
|
10
|
-
const { WRITE_BUNDLES_TRANSFORM_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/ng-package/entry-point/write-bundles.di', ngPackagrMajorVersion);
|
11
|
-
const { OPTIONS_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/ng-package/options.di', ngPackagrMajorVersion);
|
9
|
+
const { provideTransform } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/graph/transform.di', ngPackagrMajorVersion);
|
10
|
+
const { WRITE_BUNDLES_TRANSFORM_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/entry-point/write-bundles.di', ngPackagrMajorVersion);
|
11
|
+
const { OPTIONS_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/options.di', ngPackagrMajorVersion);
|
12
12
|
return provideTransform({
|
13
13
|
provide: WRITE_BUNDLES_TRANSFORM_TOKEN,
|
14
14
|
useFactory: write_bundles_transform_1.writeBundlesTransform,
|
@@ -6,5 +6,5 @@
|
|
6
6
|
* - Write the ESM2022 outputs to the file system.
|
7
7
|
* - Fake the FESM2022 outputs pointing them to the ESM2022 outputs.
|
8
8
|
*/
|
9
|
-
import type { NgPackagrOptions } from 'ng-packagr/lib/ng-package/options.di';
|
10
|
-
export declare const writeBundlesTransform: (_options: NgPackagrOptions) => import("ng-packagr/lib/graph/transform").Transform;
|
9
|
+
import type { NgPackagrOptions } from 'ng-packagr/src/lib/ng-package/options.di';
|
10
|
+
export declare const writeBundlesTransform: (_options: NgPackagrOptions) => import("ng-packagr/src/lib/graph/transform").Transform;
|
@@ -16,10 +16,10 @@ const package_imports_1 = require("../../../../utilities/ng-packagr/package-impo
|
|
16
16
|
const entry_point_1 = require("./entry-point");
|
17
17
|
const writeBundlesTransform = (_options) => {
|
18
18
|
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
19
|
-
const { BuildGraph } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/graph/build-graph', ngPackagrMajorVersion);
|
20
|
-
const { transformFromPromise } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/graph/transform', ngPackagrMajorVersion);
|
21
|
-
const { isEntryPoint, isPackage } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/ng-package/nodes', ngPackagrMajorVersion);
|
22
|
-
const { NgPackage } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/lib/ng-package/package', ngPackagrMajorVersion);
|
19
|
+
const { BuildGraph } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/graph/build-graph', ngPackagrMajorVersion);
|
20
|
+
const { transformFromPromise } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/graph/transform', ngPackagrMajorVersion);
|
21
|
+
const { isEntryPoint, isPackage } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/nodes', ngPackagrMajorVersion);
|
22
|
+
const { NgPackage } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/package', ngPackagrMajorVersion);
|
23
23
|
return transformFromPromise(async (graph) => {
|
24
24
|
const updatedGraph = new BuildGraph();
|
25
25
|
for (const entry of graph.entries()) {
|
@@ -28,9 +28,13 @@ const writeBundlesTransform = (_options) => {
|
|
28
28
|
entry.data.entryPoint = entryPoint;
|
29
29
|
entry.data.destinationFiles = entryPoint.destinationFiles;
|
30
30
|
for (const [path, outputCache] of entry.cache.outputCache.entries()) {
|
31
|
+
const normalizedPath = normalizeEsm2022Path(path, entryPoint);
|
31
32
|
// write the outputs to the file system
|
32
|
-
await (0, promises_1.mkdir)((0, node_path_1.dirname)(
|
33
|
-
await (0, promises_1.writeFile)(
|
33
|
+
await (0, promises_1.mkdir)((0, node_path_1.dirname)(normalizedPath), { recursive: true });
|
34
|
+
await (0, promises_1.writeFile)(normalizedPath, outputCache.content);
|
35
|
+
}
|
36
|
+
if (!entry.cache.outputCache.size && entryPoint.isSecondaryEntryPoint) {
|
37
|
+
await (0, promises_1.mkdir)(entryPoint.destinationPath, { recursive: true });
|
34
38
|
}
|
35
39
|
}
|
36
40
|
else if (isPackage(entry)) {
|
@@ -42,6 +46,18 @@ const writeBundlesTransform = (_options) => {
|
|
42
46
|
});
|
43
47
|
};
|
44
48
|
exports.writeBundlesTransform = writeBundlesTransform;
|
49
|
+
function normalizeEsm2022Path(path, entryPoint) {
|
50
|
+
if (!entryPoint.primaryDestinationPath) {
|
51
|
+
return path;
|
52
|
+
}
|
53
|
+
if (path.startsWith((0, node_path_1.join)(entryPoint.primaryDestinationPath, 'tmp-esm2022'))) {
|
54
|
+
return path.replace('tmp-esm2022', 'esm2022');
|
55
|
+
}
|
56
|
+
if (path.startsWith((0, node_path_1.join)(entryPoint.primaryDestinationPath, 'tmp-typings'))) {
|
57
|
+
return path.replace('tmp-typings', 'esm2022');
|
58
|
+
}
|
59
|
+
return path;
|
60
|
+
}
|
45
61
|
function toCustomNgEntryPoint(entryPoint) {
|
46
62
|
return (0, entry_point_1.createNgEntryPoint)(entryPoint.packageJson, entryPoint.ngPackageJson, entryPoint.basePath,
|
47
63
|
// @ts-expect-error this is a TS private property, but it can be accessed at runtime
|
@@ -31,9 +31,8 @@
|
|
31
31
|
},
|
32
32
|
"poll": {
|
33
33
|
"type": "number",
|
34
|
-
"description": "Enable and define the file watching poll time period in milliseconds.
|
34
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
35
35
|
}
|
36
36
|
},
|
37
|
-
"additionalProperties": false
|
38
|
-
"required": ["project"]
|
37
|
+
"additionalProperties": false
|
39
38
|
}
|
@@ -7,7 +7,6 @@ const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
7
7
|
const path_1 = require("path");
|
8
8
|
const rxjs_1 = require("rxjs");
|
9
9
|
const operators_1 = require("rxjs/operators");
|
10
|
-
const angular_version_utils_1 = require("../utilities/angular-version-utils");
|
11
10
|
const typescript_1 = require("../utilities/typescript");
|
12
11
|
const ng_packagr_1 = require("./ng-packagr-adjustments/ng-packagr");
|
13
12
|
async function initializeNgPackagr(options, context, projectDependencies) {
|
@@ -27,10 +26,7 @@ async function initializeNgPackagr(options, context, projectDependencies) {
|
|
27
26
|
*/
|
28
27
|
function createLibraryExecutor(initializeNgPackagr) {
|
29
28
|
return async function* (options, context) {
|
30
|
-
|
31
|
-
if (angularMajorVersion < 18 && options.poll !== undefined) {
|
32
|
-
throw new Error(`The "poll" option requires Angular version 18.0.0 or greater. You are currently using version ${angularVersion}.`);
|
33
|
-
}
|
29
|
+
options.project ??= (0, path_1.join)(context.projectsConfigurations.projects[context.projectName].root, 'ng-package.json');
|
34
30
|
const { dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, context.targetName, context.configurationName);
|
35
31
|
if (options.watch) {
|
36
32
|
return yield* (0, rxjs_for_await_1.eachValueFrom)((0, rxjs_1.from)(initializeNgPackagr(options, context, dependencies)).pipe((0, operators_1.switchMap)((packagr) => packagr.watch()), (0, operators_1.mapTo)({ success: true })));
|
@@ -31,9 +31,8 @@
|
|
31
31
|
},
|
32
32
|
"poll": {
|
33
33
|
"type": "number",
|
34
|
-
"description": "Enable and define the file watching poll time period in milliseconds.
|
34
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
35
35
|
}
|
36
36
|
},
|
37
|
-
"additionalProperties": false
|
38
|
-
"required": ["project"]
|
37
|
+
"additionalProperties": false
|
39
38
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function assertBuilderPackageIsInstalled(packageName: string): void;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assertBuilderPackageIsInstalled = assertBuilderPackageIsInstalled;
|
4
|
+
function assertBuilderPackageIsInstalled(packageName) {
|
5
|
+
try {
|
6
|
+
require.resolve(packageName);
|
7
|
+
}
|
8
|
+
catch {
|
9
|
+
throw new Error(`This executor requires the package ${packageName} to be installed. Please make sure it is installed and try again.`);
|
10
|
+
}
|
11
|
+
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
type
|
1
|
+
import type { buildApplication } from '@angular/build';
|
2
|
+
type Plugin = Parameters<typeof buildApplication>[2]['codePlugins'][number];
|
2
3
|
export type PluginSpec = {
|
3
4
|
path: string;
|
4
5
|
options: any;
|
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
type NgPackagrImportPath = `ng-packagr/src/${string}`;
|
2
|
+
export declare function importNgPackagrPath<T>(path: NgPackagrImportPath, ngPackagrMajorVersion: number): T;
|
3
|
+
export {};
|