@nx/angular 17.0.4 → 17.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +4 -9
- package/esm2022/mf/mf.mjs +1 -1
- package/esm2022/src/runtime/nx/data-persistence.mjs +1 -1
- package/executors.d.ts +2 -9
- package/executors.js +2 -7
- package/executors.json +9 -19
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.d.ts +1 -1
- package/generators.js +1 -3
- package/generators.json +2 -7
- package/migrations.json +0 -451
- package/ng-package.json +2 -2
- package/package.json +26 -20
- package/plugins/component-testing.d.ts +26 -1
- package/plugins/component-testing.js +4 -15
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +5 -0
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +137 -0
- package/src/{executors → builders}/module-federation-dev-server/schema.d.ts +7 -25
- package/src/{executors → builders}/module-federation-dev-server/schema.json +6 -31
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +1 -1
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +9 -15
- package/src/builders/utilities/module-federation.js +1 -1
- package/src/builders/webpack-browser/schema.d.ts +2 -6
- package/src/builders/webpack-browser/schema.json +15 -15
- package/src/builders/webpack-browser/validate-options.d.ts +2 -0
- package/src/builders/webpack-browser/validate-options.js +40 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +6 -8
- package/src/builders/{dev-server → webpack-dev-server}/lib/index.d.ts +0 -1
- package/src/builders/{dev-server → webpack-dev-server}/lib/index.js +0 -1
- package/src/builders/webpack-dev-server/lib/normalize-options.d.ts +2 -0
- package/src/builders/webpack-dev-server/lib/normalize-options.js +14 -0
- package/src/builders/webpack-dev-server/schema.d.ts +21 -0
- package/src/builders/{dev-server → webpack-dev-server}/schema.json +5 -42
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.d.ts +4 -0
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +105 -0
- package/src/builders/webpack-server/schema.d.ts +1 -0
- package/src/builders/webpack-server/schema.json +20 -7
- package/src/builders/webpack-server/validate-options.js +7 -0
- package/src/builders/webpack-server/webpack-server.impl.js +9 -4
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +3 -2
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +8 -15
- package/src/executors/browser-esbuild/lib/buildable-libs.d.ts +9 -0
- package/src/executors/{utilities → browser-esbuild/lib}/buildable-libs.js +4 -3
- package/src/executors/browser-esbuild/lib/validate-options.d.ts +2 -0
- package/src/executors/browser-esbuild/lib/validate-options.js +40 -0
- package/src/executors/browser-esbuild/schema.d.ts +1 -3
- package/src/executors/browser-esbuild/schema.json +8 -38
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.transform.js +4 -6
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.transform.js +13 -25
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ngc → ngc}/compile-source-files.d.ts +2 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ngc → ngc}/compile-source-files.js +9 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.d.ts +10 -5
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.js +86 -39
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.d.ts +16 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.js +175 -0
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +17 -5
- package/src/executors/ng-packagr-lite/schema.json +1 -1
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +3 -5
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +1 -1
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +6 -13
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +10 -5
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +86 -39
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.d.ts +15 -0
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.js +197 -0
- package/src/executors/package/package.impl.d.ts +1 -1
- package/src/executors/package/package.impl.js +15 -5
- package/src/executors/package/schema.json +3 -3
- package/src/executors/utilities/tailwindcss.d.ts +7 -0
- package/src/executors/utilities/{ng-packagr/tailwindcss.js → tailwindcss.js} +22 -5
- package/src/executors/utilities/typescript.js +1 -1
- package/src/generators/add-linting/add-linting.d.ts +1 -1
- package/src/generators/add-linting/add-linting.js +15 -9
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts +2 -2
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +5 -9
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
- package/src/generators/add-linting/schema.json +1 -1
- package/src/generators/application/application.js +17 -19
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +1 -1
- package/src/generators/application/files/base/tsconfig.json__tpl__ +2 -6
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +1 -3
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +2 -4
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +1 -1
- package/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +14 -53
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +8 -2
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +4 -6
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +2 -4
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +14 -53
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +8 -4
- package/src/generators/application/files/tsconfig.editor.json__tpl__ +5 -0
- package/src/generators/application/files/v14/.browserlistrc__tpl__ +16 -0
- package/src/generators/application/files/v14/src/environments/environment.prod.ts__tpl__ +3 -0
- package/src/generators/application/files/v14/src/environments/environment.ts__tpl__ +16 -0
- package/src/generators/application/files/v14/src/polyfills.ts__tpl__ +53 -0
- package/src/generators/application/lib/add-e2e.js +8 -22
- package/src/generators/application/lib/add-unit-test-runner.js +20 -5
- package/src/generators/application/lib/create-files.js +10 -14
- package/src/generators/application/lib/create-project.d.ts +1 -1
- package/src/generators/application/lib/create-project.js +38 -48
- package/src/generators/application/lib/index.d.ts +0 -1
- package/src/generators/application/lib/index.js +0 -1
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +6 -28
- package/src/generators/application/lib/normalized-schema.d.ts +0 -5
- package/src/generators/application/lib/update-editor-tsconfig.d.ts +1 -1
- package/src/generators/application/lib/update-editor-tsconfig.js +14 -11
- package/src/generators/application/schema.d.ts +0 -1
- package/src/generators/application/schema.json +10 -18
- package/src/generators/component/component.js +1 -4
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +3 -2
- package/src/generators/component/files/__fileName__.ts__tpl__ +2 -8
- package/src/generators/component/lib/component.js +1 -1
- package/src/generators/component/lib/index.d.ts +1 -1
- package/src/generators/component/lib/index.js +1 -1
- package/src/generators/component/lib/normalize-options.js +2 -3
- package/src/generators/{setup-mf/lib/update-tsconfig.d.ts → component/lib/validate-options.d.ts} +1 -1
- package/src/generators/component/lib/validate-options.js +8 -0
- package/src/generators/component/schema.d.ts +3 -3
- package/src/generators/component/schema.json +4 -4
- package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +8 -13
- package/src/generators/component-cypress-spec/schema.json +1 -1
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +2 -2
- package/src/generators/component-test/component-test.d.ts +1 -1
- package/src/generators/component-test/component-test.js +3 -8
- package/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ +11 -9
- package/src/generators/component-test/schema.json +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +1 -3
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +2 -3
- package/src/generators/convert-to-with-mf/schema.d.ts +0 -1
- package/src/generators/convert-to-with-mf/schema.json +0 -6
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +24 -43
- package/src/generators/directive/directive.js +1 -0
- package/src/generators/directive/files/__fileName__.ts__tpl__ +3 -1
- package/src/generators/directive/lib/index.d.ts +1 -0
- package/src/generators/directive/lib/index.js +1 -0
- package/src/generators/directive/lib/normalize-options.js +1 -3
- package/src/generators/directive/lib/validate-options.d.ts +3 -0
- package/src/generators/directive/lib/validate-options.js +8 -0
- package/src/generators/directive/schema.d.ts +3 -3
- package/src/generators/directive/schema.json +4 -4
- package/src/generators/federate-module/federate-module.js +0 -1
- package/src/generators/federate-module/lib/add-remote.d.ts +1 -1
- package/src/generators/federate-module/lib/add-remote.js +11 -2
- package/src/generators/federate-module/schema.json +3 -3
- package/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/host/host.js +9 -8
- package/src/generators/host/lib/add-ssr.d.ts +3 -0
- package/src/generators/host/lib/{update-ssr-setup.js → add-ssr.js} +14 -8
- package/src/generators/host/lib/index.d.ts +1 -1
- package/src/generators/host/lib/index.js +1 -1
- package/src/generators/host/schema.json +6 -6
- package/src/generators/init/init.d.ts +2 -2
- package/src/generators/init/init.js +137 -19
- package/src/generators/init/schema.d.ts +9 -1
- package/src/generators/init/schema.json +59 -8
- package/src/generators/library/files/ng-module/src/lib/lib.routes.ts__tpl__ +1 -1
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +1 -1
- package/src/generators/library/lib/add-load-children.js +2 -2
- package/src/generators/library/lib/add-project.js +22 -24
- package/src/generators/library/lib/add-standalone-component.d.ts +2 -2
- package/src/generators/library/lib/add-standalone-component.js +4 -5
- package/src/generators/library/lib/normalize-options.js +5 -2
- package/src/generators/library/lib/update-tsconfig.js +3 -3
- package/src/generators/library/library.js +27 -15
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +13 -13
- package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +5 -1
- package/src/generators/library-secondary-entry-point/lib/index.d.ts +1 -0
- package/src/generators/library-secondary-entry-point/lib/index.js +1 -0
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.d.ts +3 -0
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +15 -0
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +2 -3
- package/src/generators/library-secondary-entry-point/schema.d.ts +0 -1
- package/src/generators/library-secondary-entry-point/schema.json +3 -9
- package/src/generators/move/schema.json +1 -1
- package/src/generators/ng-add/migrate-from-angular-cli.js +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +7 -50
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +23 -31
- package/src/generators/ng-add/ng-add.js +8 -1
- package/src/generators/ng-add/schema.json +1 -1
- package/src/generators/ng-add/utilities/workspace.d.ts +1 -1
- package/src/generators/ng-add/utilities/workspace.js +16 -9
- package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.models.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.selectors.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +22 -0
- package/src/generators/ngrx/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +27 -0
- package/src/generators/ngrx/lib/generate-files.js +10 -1
- package/src/generators/ngrx/lib/validate-options.js +23 -0
- package/src/generators/ngrx/schema.json +3 -3
- package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.models.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.selectors.spec.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +22 -0
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +27 -0
- package/src/generators/ngrx-feature-store/lib/generate-files.js +12 -1
- package/src/generators/ngrx-feature-store/lib/validate-options.js +22 -0
- package/src/generators/ngrx-feature-store/schema.json +3 -3
- package/src/generators/ngrx-root-store/lib/normalize-options.js +1 -1
- package/src/generators/ngrx-root-store/lib/validate-options.js +15 -0
- package/src/generators/ngrx-root-store/schema.json +2 -2
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +2 -0
- package/src/generators/pipe/lib/index.d.ts +1 -0
- package/src/generators/pipe/lib/index.js +1 -0
- package/src/generators/pipe/lib/normalize-options.js +0 -1
- package/src/generators/pipe/lib/validate-options.d.ts +3 -0
- package/src/generators/pipe/lib/validate-options.js +8 -0
- package/src/generators/pipe/pipe.js +1 -0
- package/src/generators/pipe/schema.d.ts +3 -3
- package/src/generators/pipe/schema.json +4 -4
- package/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/remote/files/common/{pre-v17/src → src}/main.server.ts__tmpl__ +3 -1
- package/src/generators/remote/lib/{update-ssr-setup.d.ts → add-ssr.d.ts} +1 -1
- package/src/generators/remote/lib/{update-ssr-setup.js → add-ssr.js} +13 -9
- package/src/generators/remote/lib/index.d.ts +1 -1
- package/src/generators/remote/lib/index.js +1 -1
- package/src/generators/remote/remote.js +9 -7
- package/src/generators/remote/schema.json +6 -6
- package/src/generators/scam/lib/convert-component-to-scam.js +1 -2
- package/src/generators/scam/schema.d.ts +3 -3
- package/src/generators/scam/schema.json +2 -2
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +1 -2
- package/src/generators/scam-directive/scam-directive.js +1 -3
- package/src/generators/scam-directive/schema.d.ts +3 -4
- package/src/generators/scam-directive/schema.json +2 -8
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +1 -2
- package/src/generators/scam-pipe/scam-pipe.js +1 -3
- package/src/generators/scam-pipe/schema.d.ts +3 -4
- package/src/generators/scam-pipe/schema.json +2 -8
- package/src/generators/scam-to-standalone/scam-to-standalone.js +7 -0
- package/src/generators/scam-to-standalone/schema.json +2 -2
- package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +1 -3
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -12
- package/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +1 -1
- package/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +12 -12
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -13
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +4 -14
- package/src/generators/setup-mf/lib/add-remote-entry.js +11 -2
- package/src/generators/setup-mf/lib/add-remote-to-host.js +1 -1
- package/src/generators/setup-mf/lib/fix-bootstrap.js +18 -10
- package/src/generators/setup-mf/lib/generate-config.js +0 -3
- package/src/generators/setup-mf/lib/index.d.ts +1 -1
- package/src/generators/setup-mf/lib/index.js +1 -1
- package/src/generators/setup-mf/lib/normalize-options.js +1 -2
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +10 -10
- package/src/generators/setup-mf/lib/set-tsconfig-target.d.ts +3 -0
- package/src/generators/setup-mf/lib/set-tsconfig-target.js +16 -0
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.js +2 -2
- package/src/generators/setup-mf/schema.d.ts +0 -1
- package/src/generators/setup-mf/schema.json +3 -8
- package/src/generators/setup-mf/setup-mf.js +7 -1
- package/src/generators/setup-ssr/files/{server/server-builder/pre-v17 → ngmodule/base}/__serverFileName__ +8 -7
- package/src/generators/setup-ssr/files/ngmodule/base/src/__main__ +1 -1
- package/src/generators/setup-ssr/files/ngmodule/v14/src/__main__ +11 -0
- package/src/generators/setup-ssr/files/{server/server-builder/v17+ → standalone}/__serverFileName__ +16 -25
- package/src/generators/setup-ssr/lib/add-hydration.js +5 -11
- package/src/generators/setup-ssr/lib/generate-files.d.ts +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +16 -11
- package/src/generators/setup-ssr/lib/index.d.ts +0 -4
- package/src/generators/setup-ssr/lib/index.js +0 -4
- package/src/generators/setup-ssr/lib/normalize-options.js +1 -7
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +1 -2
- package/src/generators/setup-ssr/lib/update-project-config.js +13 -46
- package/src/generators/setup-ssr/lib/validate-options.js +2 -15
- package/src/generators/setup-ssr/schema.json +4 -4
- package/src/generators/setup-ssr/setup-ssr.js +12 -18
- package/src/generators/setup-tailwind/schema.json +1 -1
- package/src/generators/stories/schema.json +1 -1
- package/src/generators/stories/stories.js +2 -2
- package/src/generators/storybook-configuration/lib/generate-stories.js +4 -6
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +1 -3
- package/src/generators/storybook-configuration/schema.d.ts +1 -1
- package/src/generators/storybook-configuration/schema.json +7 -7
- package/src/generators/storybook-configuration/storybook-configuration.js +5 -8
- package/src/generators/utils/create-ts-config.d.ts +8 -0
- package/src/generators/utils/create-ts-config.js +35 -0
- package/src/generators/utils/dependencies.js +2 -1
- package/src/generators/utils/export-scam.js +2 -2
- package/src/generators/utils/project.d.ts +1 -0
- package/src/generators/utils/project.js +29 -2
- package/src/generators/utils/selector.d.ts +2 -2
- package/src/generators/utils/selector.js +4 -11
- package/src/generators/utils/testing.js +1 -24
- package/src/generators/utils/validations.d.ts +1 -0
- package/src/generators/utils/validations.js +14 -1
- package/src/generators/utils/version-utils.d.ts +2 -2
- package/src/generators/utils/version-utils.js +3 -3
- package/src/utils/backward-compatible-versions.d.ts +4 -6
- package/src/utils/backward-compatible-versions.js +22 -20
- package/src/utils/mf/utils.js +0 -7
- package/src/utils/mf/with-module-federation-ssr.js +0 -3
- package/src/utils/mf/with-module-federation.js +0 -3
- package/src/utils/nx-devkit/ast-utils.js +2 -4
- package/src/utils/nx-devkit/testing.js +31 -27
- package/src/utils/{index.d.ts → public-api.d.ts} +0 -5
- package/src/utils/{index.js → public-api.js} +0 -5
- package/src/utils/version-utils.d.ts +3 -3
- package/src/utils/versions.d.ts +11 -9
- package/src/utils/versions.js +12 -10
- package/src/builders/dev-server/dev-server.impl.d.ts +0 -4
- package/src/builders/dev-server/dev-server.impl.js +0 -160
- package/src/builders/dev-server/lib/normalize-options.d.ts +0 -2
- package/src/builders/dev-server/lib/normalize-options.js +0 -20
- package/src/builders/dev-server/lib/validate-options.d.ts +0 -2
- package/src/builders/dev-server/lib/validate-options.js +0 -22
- package/src/builders/dev-server/schema.d.ts +0 -39
- package/src/executors/application/application.impl.d.ts +0 -3
- package/src/executors/application/application.impl.js +0 -37
- package/src/executors/application/schema.d.ts +0 -8
- package/src/executors/application/schema.json +0 -682
- package/src/executors/application/utils/validate-options.d.ts +0 -2
- package/src/executors/application/utils/validate-options.js +0 -52
- package/src/executors/extract-i18n/extract-i18n.impl.d.ts +0 -3
- package/src/executors/extract-i18n/extract-i18n.impl.js +0 -43
- package/src/executors/extract-i18n/schema.d.ts +0 -8
- package/src/executors/extract-i18n/schema.json +0 -45
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.d.ts +0 -4
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.js +0 -56
- package/src/executors/module-federation-dev-server/lib/index.d.ts +0 -5
- package/src/executors/module-federation-dev-server/lib/index.js +0 -8
- package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -23
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.d.ts +0 -11
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.js +0 -18
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -9
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.d.ts +0 -9
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +0 -46
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -115
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +0 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +0 -34
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.d.ts +0 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.js +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.d.ts +0 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.js +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.d.ts +0 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.js +0 -18
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.d.ts +0 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.js +0 -285
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +0 -3
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +0 -28
- package/src/executors/utilities/buildable-libs.d.ts +0 -6
- package/src/executors/utilities/esbuild-extensions.d.ts +0 -10
- package/src/executors/utilities/esbuild-extensions.js +0 -50
- package/src/executors/utilities/module-loader.d.ts +0 -15
- package/src/executors/utilities/module-loader.js +0 -52
- package/src/executors/utilities/ng-compiler-cli.d.ts +0 -1
- package/src/executors/utilities/ng-compiler-cli.js +0 -8
- package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts +0 -49
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts +0 -2
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +0 -16
- package/src/executors/utilities/ng-packagr/stylesheet-processor.js +0 -209
- package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +0 -7
- package/src/executors/utilities/patch-builder-context.d.ts +0 -3
- package/src/executors/utilities/patch-builder-context.js +0 -41
- package/src/generators/add-linting/lib/buildable-project.d.ts +0 -2
- package/src/generators/add-linting/lib/buildable-project.js +0 -9
- package/src/generators/application/lib/set-generator-defaults.d.ts +0 -3
- package/src/generators/application/lib/set-generator-defaults.js +0 -17
- package/src/generators/component/lib/set-generator-defaults.d.ts +0 -3
- package/src/generators/component/lib/set-generator-defaults.js +0 -14
- package/src/generators/convert-to-application-executor/convert-to-application-executor.d.ts +0 -4
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +0 -242
- package/src/generators/convert-to-application-executor/schema.d.ts +0 -4
- package/src/generators/convert-to-application-executor/schema.json +0 -26
- package/src/generators/host/files/common/v17+/src/main.server.ts__tmpl__ +0 -67
- package/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
- package/src/generators/library/lib/set-generator-defaults.d.ts +0 -3
- package/src/generators/library/lib/set-generator-defaults.js +0 -15
- package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +0 -73
- package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
- package/src/generators/setup-mf/lib/update-tsconfig.js +0 -19
- package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +0 -56
- package/src/generators/setup-ssr/lib/add-dependencies.d.ts +0 -2
- package/src/generators/setup-ssr/lib/add-dependencies.js +0 -36
- package/src/generators/setup-ssr/lib/add-server-file.d.ts +0 -3
- package/src/generators/setup-ssr/lib/add-server-file.js +0 -31
- package/src/generators/setup-ssr/lib/constants.d.ts +0 -3
- package/src/generators/setup-ssr/lib/constants.js +0 -6
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +0 -4
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +0 -29
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +0 -3
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +0 -93
- package/src/generators/utils/add-jest.d.ts +0 -8
- package/src/generators/utils/add-jest.js +0 -36
- package/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/src/generators/utils/add-mf-env-to-inputs.js +0 -27
- package/src/generators/utils/ensure-angular-dependencies.d.ts +0 -2
- package/src/generators/utils/ensure-angular-dependencies.js +0 -35
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.d.ts +0 -2
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.js +0 -23
- package/src/generators/utils/update-project-root-tsconfig.d.ts +0 -3
- package/src/generators/utils/update-project-root-tsconfig.js +0 -26
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +0 -3
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +0 -50
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +0 -2
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +0 -75
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +0 -2
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +0 -183
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-17-1-0/update-angular-cli.js +0 -23
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts +0 -2
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +0 -37
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts +0 -2
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +0 -40
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts +0 -2
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.js +0 -26
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts +0 -2
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.js +0 -26
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-17-3-0/update-angular-cli.js +0 -23
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +0 -2
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +0 -26
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-18-1-0/update-angular-cli.js +0 -23
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -2
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
- package/src/migrations/update-18-2-0/update-angular-cli.d.ts +0 -3
- package/src/migrations/update-18-2-0/update-angular-cli.js +0 -23
- package/src/utils/targets.d.ts +0 -2
- package/src/utils/targets.js +0 -17
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/compile-ngc.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/entry-point.transform.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/entry-point/write-package.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/options.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/options.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/ng-package → ng-package}/package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{pre-v17/styles → styles}/stylesheet-processor.di.js +0 -0
- /package/src/generators/host/files/common/{pre-v17/src → src}/main.server.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx/files/{__directory__ → base/__directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.actions.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.effects.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.effects.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.facade.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.facade.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.reducer.spec.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.reducer.ts__tmpl__ +0 -0
- /package/src/generators/ngrx-feature-store/files/{__directory__ → base/__directory__}/__fileName__.selectors.ts__tmpl__ +0 -0
- /package/src/generators/setup-ssr/files/{root → base}/tsconfig.server.json__tpl__ +0 -0
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Change the package.json metadata to only use the ESM2022 output.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.nxWritePackageTransform = void 0;
|
|
10
|
-
const devkit_1 = require("@nx/devkit");
|
|
11
|
-
const node_1 = require("ng-packagr/lib/graph/node");
|
|
12
|
-
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
13
|
-
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
14
|
-
const fs_1 = require("ng-packagr/lib/utils/fs");
|
|
15
|
-
const glob_1 = require("ng-packagr/lib/utils/glob");
|
|
16
|
-
const path_1 = require("ng-packagr/lib/utils/path");
|
|
17
|
-
const path = require("path");
|
|
18
|
-
const nxWritePackageTransform = (options) => (0, transform_1.transformFromPromise)(async (graph) => {
|
|
19
|
-
const entryPoint = graph.find((0, nodes_1.isEntryPointInProgress)());
|
|
20
|
-
const ngEntryPoint = entryPoint.data.entryPoint;
|
|
21
|
-
const ngPackageNode = graph.find(nodes_1.isPackage);
|
|
22
|
-
const ngPackage = ngPackageNode.data;
|
|
23
|
-
const { destinationFiles } = entryPoint.data;
|
|
24
|
-
if (!ngEntryPoint.isSecondaryEntryPoint) {
|
|
25
|
-
devkit_1.logger.log('Copying assets');
|
|
26
|
-
try {
|
|
27
|
-
await copyAssets(graph, entryPoint, ngPackageNode);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
throw error;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
// 6. WRITE PACKAGE.JSON
|
|
34
|
-
const relativeUnixFromDestPath = (filePath) => (0, path_1.ensureUnixPath)(path.relative(ngEntryPoint.destinationPath, filePath));
|
|
35
|
-
if (!ngEntryPoint.isSecondaryEntryPoint) {
|
|
36
|
-
try {
|
|
37
|
-
devkit_1.logger.info('Writing package manifest');
|
|
38
|
-
if (!options.watch) {
|
|
39
|
-
const primary = ngPackageNode.data.primary;
|
|
40
|
-
await (0, fs_1.writeFile)(path.join(primary.destinationPath, '.npmignore'), `# Nested package.json's are only needed for development.\n**/package.json`);
|
|
41
|
-
}
|
|
42
|
-
await writePackageJson(ngEntryPoint, ngPackage, {
|
|
43
|
-
module: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
44
|
-
typings: relativeUnixFromDestPath(destinationFiles.declarations),
|
|
45
|
-
exports: generatePackageExports(ngEntryPoint, graph),
|
|
46
|
-
// webpack v4+ specific flag to enable advanced optimizations and code splitting
|
|
47
|
-
sideEffects: ngEntryPoint.packageJson.sideEffects ?? false,
|
|
48
|
-
}, !!options.watch);
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else if (ngEntryPoint.isSecondaryEntryPoint) {
|
|
55
|
-
if (options.watch) {
|
|
56
|
-
// Update the watch version of the primary entry point `package.json` file.
|
|
57
|
-
// this is needed because of Webpack's 5 `cachemanagedpaths`
|
|
58
|
-
// https://github.com/ng-packagr/ng-packagr/issues/2069
|
|
59
|
-
const primary = ngPackageNode.data.primary;
|
|
60
|
-
const packageJsonPath = path.join(primary.destinationPath, 'package.json');
|
|
61
|
-
if (await (0, fs_1.exists)(packageJsonPath)) {
|
|
62
|
-
const packageJson = JSON.parse(await (0, fs_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
|
|
63
|
-
packageJson.version = generateWatchVersion();
|
|
64
|
-
await (0, fs_1.writeFile)(path.join(primary.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// Write a package.json in each secondary entry-point
|
|
68
|
-
// This is need for esbuild to secondary entry-points in dist correctly.
|
|
69
|
-
await (0, fs_1.writeFile)(path.join(ngEntryPoint.destinationPath, 'package.json'), JSON.stringify({ module: relativeUnixFromDestPath(destinationFiles.esm2022) }, undefined, 2));
|
|
70
|
-
}
|
|
71
|
-
devkit_1.logger.info(`Built ${ngEntryPoint.moduleId}`);
|
|
72
|
-
return graph;
|
|
73
|
-
});
|
|
74
|
-
exports.nxWritePackageTransform = nxWritePackageTransform;
|
|
75
|
-
async function copyAssets(graph, entryPointNode, ngPackageNode) {
|
|
76
|
-
const ngPackage = ngPackageNode.data;
|
|
77
|
-
const globsForceIgnored = [
|
|
78
|
-
'.gitkeep',
|
|
79
|
-
'**/.DS_Store',
|
|
80
|
-
'**/Thumbs.db',
|
|
81
|
-
`${ngPackage.dest}/**`,
|
|
82
|
-
];
|
|
83
|
-
const assets = [];
|
|
84
|
-
for (const assetPath of ngPackage.assets) {
|
|
85
|
-
let asset;
|
|
86
|
-
if (typeof assetPath === 'object') {
|
|
87
|
-
asset = { ...assetPath };
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
const [isDir, isFile] = await (0, fs_1.stat)(path.join(ngPackage.src, assetPath))
|
|
91
|
-
.then((stats) => [stats.isDirectory(), stats.isFile()])
|
|
92
|
-
.catch(() => [false, false]);
|
|
93
|
-
if (isDir) {
|
|
94
|
-
asset = { glob: '**/*', input: assetPath, output: assetPath };
|
|
95
|
-
}
|
|
96
|
-
else if (isFile) {
|
|
97
|
-
// filenames are their own glob
|
|
98
|
-
asset = {
|
|
99
|
-
glob: path.basename(assetPath),
|
|
100
|
-
input: path.dirname(assetPath),
|
|
101
|
-
output: path.dirname(assetPath),
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
asset = { glob: assetPath, input: '/', output: '/' };
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
asset.input = path.join(ngPackage.src, asset.input);
|
|
109
|
-
asset.output = path.join(ngPackage.dest, asset.output);
|
|
110
|
-
const isAncestorPath = (target, datum) => path.relative(datum, target).startsWith('..');
|
|
111
|
-
if (isAncestorPath(asset.input, ngPackage.src)) {
|
|
112
|
-
throw new Error('Cannot read assets from a location outside of the project root.');
|
|
113
|
-
}
|
|
114
|
-
if (isAncestorPath(asset.output, ngPackage.dest)) {
|
|
115
|
-
throw new Error('Cannot write assets to a location outside of the output path.');
|
|
116
|
-
}
|
|
117
|
-
assets.push(asset);
|
|
118
|
-
}
|
|
119
|
-
for (const asset of assets) {
|
|
120
|
-
const filePaths = await (0, glob_1.globFiles)(asset.glob, {
|
|
121
|
-
cwd: asset.input,
|
|
122
|
-
ignore: [...(asset.ignore ?? []), ...globsForceIgnored],
|
|
123
|
-
dot: true,
|
|
124
|
-
onlyFiles: true,
|
|
125
|
-
followSymbolicLinks: asset.followSymlinks,
|
|
126
|
-
});
|
|
127
|
-
for (const filePath of filePaths) {
|
|
128
|
-
const fileSrcFullPath = path.join(asset.input, filePath);
|
|
129
|
-
const fileDestFullPath = path.join(asset.output, filePath);
|
|
130
|
-
const nodeUri = (0, nodes_1.fileUrl)((0, path_1.ensureUnixPath)(fileSrcFullPath));
|
|
131
|
-
let node = graph.get(nodeUri);
|
|
132
|
-
if (!node) {
|
|
133
|
-
node = new node_1.Node(nodeUri);
|
|
134
|
-
graph.put(node);
|
|
135
|
-
}
|
|
136
|
-
entryPointNode.dependsOn(node);
|
|
137
|
-
await (0, fs_1.copyFile)(fileSrcFullPath, fileDestFullPath);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Creates and writes a `package.json` file of the entry point used by the `node_module`
|
|
143
|
-
* resolution strategies.
|
|
144
|
-
*
|
|
145
|
-
* #### Example
|
|
146
|
-
*
|
|
147
|
-
* A consumer of the entry point depends on it by `import {..} from '@my/module/id';`.
|
|
148
|
-
* The module id `@my/module/id` will be resolved to the `package.json` file that is written by
|
|
149
|
-
* this build step.
|
|
150
|
-
* The properties `main`, `module`, `typings` (and so on) in the `package.json` point to the
|
|
151
|
-
* flattened JavaScript bundles, type definitions, (...).
|
|
152
|
-
*
|
|
153
|
-
* @param entryPoint An entry point of an Angular package / library
|
|
154
|
-
* @param additionalProperties Additional properties, e.g. binary artefacts (bundle files), to merge into `package.json`
|
|
155
|
-
*/
|
|
156
|
-
async function writePackageJson(entryPoint, pkg, additionalProperties, isWatchMode) {
|
|
157
|
-
// set additional properties
|
|
158
|
-
const packageJson = { ...entryPoint.packageJson, ...additionalProperties };
|
|
159
|
-
// read tslib version from `@angular/compiler` so that our tslib
|
|
160
|
-
// version at least matches that of angular if we use require('tslib').version
|
|
161
|
-
// it will get what installed and not the minimum version nor if it is a `~` or `^`
|
|
162
|
-
// this is only required for primary
|
|
163
|
-
if (isWatchMode) {
|
|
164
|
-
// Needed because of Webpack's 5 `cachemanagedpaths`
|
|
165
|
-
// https://github.com/angular/angular-cli/issues/20962
|
|
166
|
-
packageJson.version = generateWatchVersion();
|
|
167
|
-
}
|
|
168
|
-
if (!packageJson.peerDependencies?.tslib &&
|
|
169
|
-
!packageJson.dependencies?.tslib) {
|
|
170
|
-
const { peerDependencies: angularPeerDependencies = {}, dependencies: angularDependencies = {}, } = require('@angular/compiler/package.json');
|
|
171
|
-
const tsLibVersion = angularPeerDependencies.tslib || angularDependencies.tslib;
|
|
172
|
-
if (tsLibVersion) {
|
|
173
|
-
packageJson.dependencies = {
|
|
174
|
-
...packageJson.dependencies,
|
|
175
|
-
tslib: tsLibVersion,
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
else if (packageJson.peerDependencies?.tslib) {
|
|
180
|
-
devkit_1.logger.warn(`'tslib' is no longer recommended to be used as a 'peerDependencies'. Moving it to 'dependencies'.`);
|
|
181
|
-
packageJson.dependencies = {
|
|
182
|
-
...(packageJson.dependencies || {}),
|
|
183
|
-
tslib: packageJson.peerDependencies.tslib,
|
|
184
|
-
};
|
|
185
|
-
delete packageJson.peerDependencies.tslib;
|
|
186
|
-
}
|
|
187
|
-
// Verify non-peerDependencies as they can easily lead to duplicate installs or version conflicts
|
|
188
|
-
// in the node_modules folder of an application
|
|
189
|
-
const allowedList = pkg.allowedNonPeerDependencies.map((value) => new RegExp(value));
|
|
190
|
-
try {
|
|
191
|
-
checkNonPeerDependencies(packageJson, 'dependencies', allowedList);
|
|
192
|
-
}
|
|
193
|
-
catch (e) {
|
|
194
|
-
await (0, fs_1.rmdir)(entryPoint.destinationPath, { recursive: true });
|
|
195
|
-
throw e;
|
|
196
|
-
}
|
|
197
|
-
// Removes scripts from package.json after build
|
|
198
|
-
if (packageJson.scripts) {
|
|
199
|
-
if (pkg.keepLifecycleScripts !== true) {
|
|
200
|
-
devkit_1.logger.info(`Removing scripts section in package.json as it's considered a potential security vulnerability.`);
|
|
201
|
-
delete packageJson.scripts;
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
devkit_1.logger.warn(`You enabled keepLifecycleScripts explicitly. The scripts section in package.json will be published to npm.`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
// keep the dist package.json clean
|
|
208
|
-
// this will not throw if ngPackage field does not exist
|
|
209
|
-
delete packageJson.ngPackage;
|
|
210
|
-
const packageJsonPropertiesToDelete = [
|
|
211
|
-
'stylelint',
|
|
212
|
-
'prettier',
|
|
213
|
-
'browserslist',
|
|
214
|
-
'devDependencies',
|
|
215
|
-
'jest',
|
|
216
|
-
'workspaces',
|
|
217
|
-
'husky',
|
|
218
|
-
];
|
|
219
|
-
for (const prop of packageJsonPropertiesToDelete) {
|
|
220
|
-
if (prop in packageJson) {
|
|
221
|
-
delete packageJson[prop];
|
|
222
|
-
devkit_1.logger.info(`Removing ${prop} section in package.json.`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
packageJson.name = entryPoint.moduleId;
|
|
226
|
-
await (0, fs_1.writeFile)(path.join(entryPoint.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
|
|
227
|
-
}
|
|
228
|
-
function checkNonPeerDependencies(packageJson, property, allowed) {
|
|
229
|
-
if (!packageJson[property]) {
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
for (const dep of Object.keys(packageJson[property])) {
|
|
233
|
-
if (!allowed.some((regex) => regex.test(dep))) {
|
|
234
|
-
devkit_1.logger.warn(`Distributing npm packages with '${property}' is not recommended. Please consider adding ${dep} to 'peerDependencies' or remove it from '${property}'.`);
|
|
235
|
-
throw new Error(`Dependency ${dep} must be explicitly allowed using the "allowedNonPeerDependencies" option.`);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Generates the `package.json` package exports following APF v13.
|
|
241
|
-
* This is supposed to match with: https://github.com/angular/angular/blob/e0667efa6eada64d1fb8b143840689090fc82e52/packages/bazel/src/ng_package/packager.ts#L415.
|
|
242
|
-
*/
|
|
243
|
-
function generatePackageExports({ destinationPath, packageJson }, graph) {
|
|
244
|
-
const exports = packageJson.exports
|
|
245
|
-
? JSON.parse(JSON.stringify(packageJson.exports))
|
|
246
|
-
: {};
|
|
247
|
-
const insertMappingOrError = (subpath, mapping) => {
|
|
248
|
-
exports[subpath] ??= {};
|
|
249
|
-
const subpathExport = exports[subpath];
|
|
250
|
-
// Go through all conditions that should be inserted. If the condition is already
|
|
251
|
-
// manually set of the subpath export, we throw an error. In general, we allow for
|
|
252
|
-
// additional conditions to be set. These will always precede the generated ones.
|
|
253
|
-
for (const conditionName of Object.keys(mapping)) {
|
|
254
|
-
if (subpathExport[conditionName] !== undefined) {
|
|
255
|
-
devkit_1.logger.warn(`Found a conflicting export condition for "${subpath}". The "${conditionName}" ` +
|
|
256
|
-
`condition would be overridden by ng-packagr. Please unset it.`);
|
|
257
|
-
}
|
|
258
|
-
// **Note**: The order of the conditions is preserved even though we are setting
|
|
259
|
-
// the conditions once at a time (the latest assignment will be at the end).
|
|
260
|
-
subpathExport[conditionName] = mapping[conditionName];
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
const relativeUnixFromDestPath = (filePath) => './' + (0, path_1.ensureUnixPath)(path.relative(destinationPath, filePath));
|
|
264
|
-
insertMappingOrError('./package.json', { default: './package.json' });
|
|
265
|
-
const entryPoints = graph.filter(nodes_1.isEntryPoint);
|
|
266
|
-
for (const entryPoint of entryPoints) {
|
|
267
|
-
const { destinationFiles, isSecondaryEntryPoint } = entryPoint.data.entryPoint;
|
|
268
|
-
const subpath = isSecondaryEntryPoint
|
|
269
|
-
? `./${destinationFiles.directory}`
|
|
270
|
-
: '.';
|
|
271
|
-
insertMappingOrError(subpath, {
|
|
272
|
-
types: relativeUnixFromDestPath(destinationFiles.declarations),
|
|
273
|
-
esm2022: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
274
|
-
esm: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
275
|
-
default: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
return exports;
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Generates a new version for the package `package.json` when runing in watch mode.
|
|
282
|
-
*/
|
|
283
|
-
function generateWatchVersion() {
|
|
284
|
-
return `0.0.0-watch+${Date.now()}`;
|
|
285
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNgPackagrInstance = void 0;
|
|
4
|
-
const ng_packagr_1 = require("ng-packagr");
|
|
5
|
-
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
6
|
-
async function getNgPackagrInstance(options) {
|
|
7
|
-
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
8
|
-
if (angularMajorVersion >= 17) {
|
|
9
|
-
const { STYLESHEET_PROCESSOR } = await Promise.resolve().then(() => require('../../utilities/ng-packagr/stylesheet-processor.di'));
|
|
10
|
-
const packagr = (0, ng_packagr_1.ngPackagr)();
|
|
11
|
-
packagr.withProviders([STYLESHEET_PROCESSOR]);
|
|
12
|
-
return packagr;
|
|
13
|
-
}
|
|
14
|
-
const { NX_ENTRY_POINT_PROVIDERS } = await Promise.resolve().then(() => require('./ng-package/entry-point/entry-point.di'));
|
|
15
|
-
const { nxProvideOptions } = await Promise.resolve().then(() => require('./ng-package/options.di'));
|
|
16
|
-
const { NX_PACKAGE_PROVIDERS, NX_PACKAGE_TRANSFORM } = await Promise.resolve().then(() => require('./ng-package/package.di'));
|
|
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);
|
|
26
|
-
return packagr;
|
|
27
|
-
}
|
|
28
|
-
exports.getNgPackagrInstance = getNgPackagrInstance;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ExecutorContext } from '@nx/devkit';
|
|
2
|
-
import { type DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
|
|
3
|
-
export declare function createTmpTsConfigForBuildableLibs(tsConfigPath: string, context: ExecutorContext): {
|
|
4
|
-
tsConfigPath: string;
|
|
5
|
-
dependencies: DependentBuildableProjectNode[];
|
|
6
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/index-html-generator';
|
|
2
|
-
import type { Plugin } from 'esbuild';
|
|
3
|
-
import type { Connect } from 'vite';
|
|
4
|
-
export type PluginSpec = {
|
|
5
|
-
path: string;
|
|
6
|
-
options: any;
|
|
7
|
-
};
|
|
8
|
-
export declare function loadPlugins(plugins: string[] | PluginSpec[] | undefined, tsConfig: string): Promise<Plugin[]>;
|
|
9
|
-
export declare function loadMiddleware(middlewareFns: string[] | undefined, tsConfig: string): Promise<Connect.NextHandleFunction[]>;
|
|
10
|
-
export declare function loadIndexHtmlTransformer(indexHtmlTransformerPath: string, tsConfig: string): Promise<IndexHtmlTransform>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadIndexHtmlTransformer = exports.loadMiddleware = exports.loadPlugins = void 0;
|
|
4
|
-
const internal_1 = require("@nx/js/src/internal");
|
|
5
|
-
const module_loader_1 = require("./module-loader");
|
|
6
|
-
async function loadPlugins(plugins, tsConfig) {
|
|
7
|
-
if (!plugins?.length) {
|
|
8
|
-
return [];
|
|
9
|
-
}
|
|
10
|
-
const cleanupTranspiler = (0, internal_1.registerTsProject)(tsConfig);
|
|
11
|
-
try {
|
|
12
|
-
return await Promise.all(plugins.map((plugin) => loadPlugin(plugin)));
|
|
13
|
-
}
|
|
14
|
-
finally {
|
|
15
|
-
cleanupTranspiler();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.loadPlugins = loadPlugins;
|
|
19
|
-
async function loadPlugin(pluginSpec) {
|
|
20
|
-
const pluginPath = typeof pluginSpec === 'string' ? pluginSpec : pluginSpec.path;
|
|
21
|
-
let plugin = await (0, module_loader_1.loadModule)(pluginPath);
|
|
22
|
-
if (typeof plugin === 'function') {
|
|
23
|
-
plugin =
|
|
24
|
-
typeof pluginSpec === 'object' ? plugin(pluginSpec.options) : plugin();
|
|
25
|
-
}
|
|
26
|
-
return plugin;
|
|
27
|
-
}
|
|
28
|
-
async function loadMiddleware(middlewareFns, tsConfig) {
|
|
29
|
-
if (!middlewareFns?.length) {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
const cleanupTranspiler = (0, internal_1.registerTsProject)(tsConfig);
|
|
33
|
-
try {
|
|
34
|
-
return await Promise.all(middlewareFns.map((fnPath) => (0, module_loader_1.loadModule)(fnPath)));
|
|
35
|
-
}
|
|
36
|
-
finally {
|
|
37
|
-
cleanupTranspiler();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.loadMiddleware = loadMiddleware;
|
|
41
|
-
async function loadIndexHtmlTransformer(indexHtmlTransformerPath, tsConfig) {
|
|
42
|
-
const cleanupTranspiler = (0, internal_1.registerTsProject)(tsConfig);
|
|
43
|
-
try {
|
|
44
|
-
return await (0, module_loader_1.loadModule)(indexHtmlTransformerPath);
|
|
45
|
-
}
|
|
46
|
-
finally {
|
|
47
|
-
cleanupTranspiler();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.loadIndexHtmlTransformer = loadIndexHtmlTransformer;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
export declare function loadModule<T = any>(path: string): Promise<T>;
|
|
3
|
-
/**
|
|
4
|
-
* This uses a dynamic import to load a module which may be ESM.
|
|
5
|
-
* CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
|
|
6
|
-
* will currently, unconditionally downlevel dynamic import into a require call.
|
|
7
|
-
* require calls cannot load ESM code and will result in a runtime error. To workaround
|
|
8
|
-
* this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
|
|
9
|
-
* Once TypeScript provides support for keeping the dynamic import this workaround can
|
|
10
|
-
* be dropped.
|
|
11
|
-
*
|
|
12
|
-
* @param modulePath The path of the module to load.
|
|
13
|
-
* @returns A Promise that resolves to the dynamically imported module.
|
|
14
|
-
*/
|
|
15
|
-
export declare function loadEsmModule<T>(modulePath: string | URL): Promise<T>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadEsmModule = exports.loadModule = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const node_url_1 = require("node:url");
|
|
6
|
-
async function loadModule(path) {
|
|
7
|
-
switch ((0, path_1.extname)(path)) {
|
|
8
|
-
case '.mjs': {
|
|
9
|
-
const result = await loadEsmModule((0, node_url_1.pathToFileURL)(path));
|
|
10
|
-
return result.default ?? result;
|
|
11
|
-
}
|
|
12
|
-
case '.cjs': {
|
|
13
|
-
const result = require(path);
|
|
14
|
-
return result.default ?? result;
|
|
15
|
-
}
|
|
16
|
-
default:
|
|
17
|
-
// it can be CommonJS or ESM, try both
|
|
18
|
-
try {
|
|
19
|
-
const result = require(path);
|
|
20
|
-
return result.default ?? result;
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
if (e.code === 'ERR_REQUIRE_ESM') {
|
|
24
|
-
const result = await loadEsmModule((0, node_url_1.pathToFileURL)(path));
|
|
25
|
-
return result.default ?? result;
|
|
26
|
-
}
|
|
27
|
-
throw e;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.loadModule = loadModule;
|
|
32
|
-
/**
|
|
33
|
-
* Lazily compiled dynamic import loader function.
|
|
34
|
-
*/
|
|
35
|
-
let load;
|
|
36
|
-
/**
|
|
37
|
-
* This uses a dynamic import to load a module which may be ESM.
|
|
38
|
-
* CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
|
|
39
|
-
* will currently, unconditionally downlevel dynamic import into a require call.
|
|
40
|
-
* require calls cannot load ESM code and will result in a runtime error. To workaround
|
|
41
|
-
* this, a Function constructor is used to prevent TypeScript from changing the dynamic import.
|
|
42
|
-
* Once TypeScript provides support for keeping the dynamic import this workaround can
|
|
43
|
-
* be dropped.
|
|
44
|
-
*
|
|
45
|
-
* @param modulePath The path of the module to load.
|
|
46
|
-
* @returns A Promise that resolves to the dynamically imported module.
|
|
47
|
-
*/
|
|
48
|
-
function loadEsmModule(modulePath) {
|
|
49
|
-
load ??= new Function('modulePath', `return import(modulePath);`);
|
|
50
|
-
return load(modulePath);
|
|
51
|
-
}
|
|
52
|
-
exports.loadEsmModule = loadEsmModule;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ngCompilerCli(): Promise<typeof import('@angular/compiler-cli')>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ngCompilerCli = void 0;
|
|
4
|
-
const module_loader_1 = require("./module-loader");
|
|
5
|
-
function ngCompilerCli() {
|
|
6
|
-
return (0, module_loader_1.loadEsmModule)('@angular/compiler-cli');
|
|
7
|
-
}
|
|
8
|
-
exports.ngCompilerCli = ngCompilerCli;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr source.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Use our own function to get the TailwindCSS config path to support a
|
|
6
|
-
* config at the root of the workspace.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum CssUrl {
|
|
9
|
-
inline = "inline",
|
|
10
|
-
none = "none"
|
|
11
|
-
}
|
|
12
|
-
export declare class StylesheetProcessor {
|
|
13
|
-
private readonly projectBasePath;
|
|
14
|
-
private readonly basePath;
|
|
15
|
-
private readonly cssUrl?;
|
|
16
|
-
private readonly includePaths?;
|
|
17
|
-
private readonly cacheDirectory?;
|
|
18
|
-
private renderWorker;
|
|
19
|
-
constructor(projectBasePath: string, basePath: string, cssUrl?: CssUrl, includePaths?: string[], cacheDirectory?: string | false);
|
|
20
|
-
process({ filePath, content, }: {
|
|
21
|
-
filePath: string;
|
|
22
|
-
content: string;
|
|
23
|
-
}): Promise<string>;
|
|
24
|
-
/** Destory workers in pool. */
|
|
25
|
-
destroy(): void;
|
|
26
|
-
private createRenderWorker;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* This class is used when ng-packagr version is 17.2.0. The async `loadPostcssConfiguration` function
|
|
30
|
-
* introduced in ng-packagr 17.2.0 causes a memory leak due to multiple workers being created. We must
|
|
31
|
-
* keep this class to support any workspace that might be using ng-packagr 17.2.0 where that function
|
|
32
|
-
* need to be awaited.
|
|
33
|
-
*/
|
|
34
|
-
export declare class AsyncStylesheetProcessor {
|
|
35
|
-
private readonly projectBasePath;
|
|
36
|
-
private readonly basePath;
|
|
37
|
-
private readonly cssUrl?;
|
|
38
|
-
private readonly includePaths?;
|
|
39
|
-
private readonly cacheDirectory?;
|
|
40
|
-
private renderWorker;
|
|
41
|
-
constructor(projectBasePath: string, basePath: string, cssUrl?: CssUrl, includePaths?: string[], cacheDirectory?: string | false);
|
|
42
|
-
process({ filePath, content, }: {
|
|
43
|
-
filePath: string;
|
|
44
|
-
content: string;
|
|
45
|
-
}): Promise<string>;
|
|
46
|
-
/** Destory workers in pool. */
|
|
47
|
-
destroy(): void;
|
|
48
|
-
private createRenderWorker;
|
|
49
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STYLESHEET_PROCESSOR = void 0;
|
|
4
|
-
const stylesheet_processor_di_1 = require("ng-packagr/lib/styles/stylesheet-processor.di");
|
|
5
|
-
const angular_version_utils_1 = require("../angular-version-utils");
|
|
6
|
-
const stylesheet_processor_1 = require("./stylesheet-processor");
|
|
7
|
-
exports.STYLESHEET_PROCESSOR = {
|
|
8
|
-
provide: stylesheet_processor_di_1.STYLESHEET_PROCESSOR_TOKEN,
|
|
9
|
-
useFactory: () => {
|
|
10
|
-
const { version: ngPackagrVersion } = (0, angular_version_utils_1.getInstalledPackageVersionInfo)('ng-packagr');
|
|
11
|
-
return ngPackagrVersion !== '17.2.0'
|
|
12
|
-
? stylesheet_processor_1.StylesheetProcessor
|
|
13
|
-
: stylesheet_processor_1.AsyncStylesheetProcessor;
|
|
14
|
-
},
|
|
15
|
-
deps: [],
|
|
16
|
-
};
|