@nx/angular 0.0.0-pr-22179-271588f
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 +22 -0
- package/README.md +68 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/mf/index.mjs +2 -0
- package/esm2022/mf/mf.mjs +48 -0
- package/esm2022/mf/nx-angular-mf.mjs +5 -0
- package/esm2022/nx-angular.mjs +5 -0
- package/esm2022/src/runtime/nx/data-persistence.mjs +344 -0
- package/esm2022/testing/index.mjs +2 -0
- package/esm2022/testing/nx-angular-testing.mjs +5 -0
- package/esm2022/testing/src/testing-utils.mjs +36 -0
- package/executors.d.ts +16 -0
- package/executors.js +17 -0
- package/executors.json +61 -0
- package/fesm2022/nx-angular-mf.mjs +54 -0
- package/fesm2022/nx-angular-mf.mjs.map +1 -0
- package/fesm2022/nx-angular-testing.mjs +43 -0
- package/fesm2022/nx-angular-testing.mjs.map +1 -0
- package/fesm2022/nx-angular.mjs +351 -0
- package/fesm2022/nx-angular.mjs.map +1 -0
- package/generators.d.ts +30 -0
- package/generators.js +35 -0
- package/generators.json +186 -0
- package/index.d.ts +1 -0
- package/index.js +8 -0
- package/mf/index.d.ts +1 -0
- package/mf/index.js +7 -0
- package/mf/mf.d.ts +4 -0
- package/mf/mf.js +53 -0
- package/mf/ng-package.json +6 -0
- package/migrations.json +1717 -0
- package/module-federation/index.d.ts +2 -0
- package/module-federation/index.js +7 -0
- package/ng-package.json +31 -0
- package/package.json +109 -0
- package/plugins/component-testing.d.ts +20 -0
- package/plugins/component-testing.js +325 -0
- package/src/builders/dev-server/dev-server.impl.d.ts +4 -0
- package/src/builders/dev-server/dev-server.impl.js +160 -0
- package/src/builders/dev-server/lib/index.d.ts +2 -0
- package/src/builders/dev-server/lib/index.js +5 -0
- package/src/builders/dev-server/lib/normalize-options.d.ts +2 -0
- package/src/builders/dev-server/lib/normalize-options.js +20 -0
- package/src/builders/dev-server/lib/validate-options.d.ts +2 -0
- package/src/builders/dev-server/lib/validate-options.js +22 -0
- package/src/builders/dev-server/schema.d.ts +39 -0
- package/src/builders/dev-server/schema.json +153 -0
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.d.ts +4 -0
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +99 -0
- package/src/builders/module-federation-dev-ssr/schema.d.ts +17 -0
- package/src/builders/module-federation-dev-ssr/schema.json +90 -0
- package/src/builders/utilities/buildable-libs.d.ts +9 -0
- package/src/builders/utilities/buildable-libs.js +15 -0
- package/src/builders/utilities/module-federation.d.ts +6 -0
- package/src/builders/utilities/module-federation.js +95 -0
- package/src/builders/utilities/webpack.d.ts +6 -0
- package/src/builders/utilities/webpack.js +45 -0
- package/src/builders/webpack-browser/schema.d.ts +13 -0
- package/src/builders/webpack-browser/schema.json +600 -0
- package/src/builders/webpack-browser/webpack-browser.impl.d.ts +5 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +79 -0
- package/src/builders/webpack-server/schema.d.ts +8 -0
- package/src/builders/webpack-server/schema.json +321 -0
- package/src/builders/webpack-server/validate-options.d.ts +2 -0
- package/src/builders/webpack-server/validate-options.js +33 -0
- package/src/builders/webpack-server/webpack-server.impl.d.ts +5 -0
- package/src/builders/webpack-server/webpack-server.impl.js +61 -0
- package/src/executors/application/application.impl.d.ts +3 -0
- package/src/executors/application/application.impl.js +37 -0
- package/src/executors/application/schema.d.ts +8 -0
- package/src/executors/application/schema.json +678 -0
- package/src/executors/application/utils/validate-options.d.ts +2 -0
- package/src/executors/application/utils/validate-options.js +47 -0
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +9 -0
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +34 -0
- package/src/executors/browser-esbuild/schema.d.ts +7 -0
- package/src/executors/browser-esbuild/schema.json +585 -0
- package/src/executors/delegate-build/delegate-build.impl.d.ts +8 -0
- package/src/executors/delegate-build/delegate-build.impl.js +17 -0
- package/src/executors/delegate-build/schema.d.ts +6 -0
- package/src/executors/delegate-build/schema.json +34 -0
- package/src/executors/extract-i18n/extract-i18n.impl.d.ts +3 -0
- package/src/executors/extract-i18n/extract-i18n.impl.js +43 -0
- package/src/executors/extract-i18n/schema.d.ts +8 -0
- package/src/executors/extract-i18n/schema.json +45 -0
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.d.ts +4 -0
- package/src/executors/module-federation-dev-server/lib/build-static-remotes.js +48 -0
- package/src/executors/module-federation-dev-server/lib/index.d.ts +5 -0
- package/src/executors/module-federation-dev-server/lib/index.js +8 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +2 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +23 -0
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.d.ts +11 -0
- package/src/executors/module-federation-dev-server/lib/parse-static-remotes-config.js +18 -0
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +9 -0
- package/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +29 -0
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.d.ts +9 -0
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +46 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +4 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +115 -0
- package/src/executors/module-federation-dev-server/schema.d.ts +43 -0
- package/src/executors/module-federation-dev-server/schema.json +165 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +3 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +34 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.d.ts +14 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.js +27 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.d.ts +12 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.js +52 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.d.ts +15 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.js +28 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.d.ts +30 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.js +52 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.d.ts +12 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.js +20 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.d.ts +9 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.js +319 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.d.ts +14 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js +34 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.d.ts +14 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.js +37 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts +13 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.js +178 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.d.ts +42 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.d.ts +10 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.js +17 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.js +201 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.d.ts +2 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.di.js +12 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.d.ts +8 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-bundles.transform.js +12 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.d.ts +8 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.di.js +18 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.d.ts +8 -0
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.js +285 -0
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.d.ts +6 -0
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +20 -0
- package/src/executors/ng-packagr-lite/schema.json +43 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.d.ts +14 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.js +26 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.d.ts +12 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +70 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.d.ts +13 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.js +32 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.d.ts +14 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +34 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.d.ts +14 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.js +37 -0
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +3 -0
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +28 -0
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +14 -0
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +183 -0
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +36 -0
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.d.ts +10 -0
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.js +17 -0
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +194 -0
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.d.ts +1 -0
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +10 -0
- package/src/executors/package/package.impl.d.ts +16 -0
- package/src/executors/package/package.impl.js +42 -0
- package/src/executors/package/schema.d.ts +6 -0
- package/src/executors/package/schema.json +45 -0
- package/src/executors/utilities/angular-version-utils.d.ts +6 -0
- package/src/executors/utilities/angular-version-utils.js +19 -0
- package/src/executors/utilities/buildable-libs.d.ts +6 -0
- package/src/executors/utilities/buildable-libs.js +16 -0
- package/src/executors/utilities/esbuild-extensions.d.ts +10 -0
- package/src/executors/utilities/esbuild-extensions.js +50 -0
- package/src/executors/utilities/module-loader.d.ts +15 -0
- package/src/executors/utilities/module-loader.js +52 -0
- package/src/executors/utilities/ng-compiler-cli.d.ts +1 -0
- package/src/executors/utilities/ng-compiler-cli.js +8 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts +27 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts +2 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +10 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.js +130 -0
- package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +7 -0
- package/src/executors/utilities/ng-packagr/tailwindcss.js +56 -0
- package/src/executors/utilities/patch-builder-context.d.ts +3 -0
- package/src/executors/utilities/patch-builder-context.js +41 -0
- package/src/executors/utilities/typescript.d.ts +13 -0
- package/src/executors/utilities/typescript.js +43 -0
- package/src/generators/add-linting/add-linting.d.ts +4 -0
- package/src/generators/add-linting/add-linting.js +105 -0
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts +2 -0
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +16 -0
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +81 -0
- package/src/generators/add-linting/lib/create-eslint-configuration.js +121 -0
- package/src/generators/add-linting/schema.d.ts +9 -0
- package/src/generators/add-linting/schema.json +51 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +76 -0
- package/src/generators/application/files/base/src/assets/.gitkeep__tpl__ +0 -0
- package/src/generators/application/files/base/src/favicon.ico +0 -0
- package/src/generators/application/files/base/src/index.html__tpl__ +13 -0
- package/src/generators/application/files/base/src/styles.__style__ +1 -0
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +10 -0
- package/src/generators/application/files/base/tsconfig.editor.json__tpl__ +5 -0
- package/src/generators/application/files/base/tsconfig.json__tpl__ +18 -0
- package/src/generators/application/files/ng-module/src/app/app.component.__style__ +0 -0
- package/src/generators/application/files/ng-module/src/app/app.component.html__tpl__ +1 -0
- package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +28 -0
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +15 -0
- package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +17 -0
- package/src/generators/application/files/ng-module/src/app/app.routes.ts__tpl__ +3 -0
- package/src/generators/application/files/ng-module/src/app/nx-welcome.component.ts__tpl__ +834 -0
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +6 -0
- 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.html__tpl__ +1 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +27 -0
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +19 -0
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +7 -0
- package/src/generators/application/files/standalone-components/src/app/app.routes.ts__tpl__ +3 -0
- package/src/generators/application/files/standalone-components/src/app/nx-welcome.component.ts__tpl__ +837 -0
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +7 -0
- package/src/generators/application/lib/add-e2e.d.ts +3 -0
- package/src/generators/application/lib/add-e2e.js +77 -0
- package/src/generators/application/lib/add-linting.d.ts +3 -0
- package/src/generators/application/lib/add-linting.js +20 -0
- package/src/generators/application/lib/add-proxy-config.d.ts +3 -0
- package/src/generators/application/lib/add-proxy-config.js +25 -0
- package/src/generators/application/lib/add-unit-test-runner.d.ts +3 -0
- package/src/generators/application/lib/add-unit-test-runner.js +16 -0
- package/src/generators/application/lib/create-files.d.ts +3 -0
- package/src/generators/application/lib/create-files.js +58 -0
- package/src/generators/application/lib/create-project.d.ts +3 -0
- package/src/generators/application/lib/create-project.js +111 -0
- package/src/generators/application/lib/enable-strict-type-checking.d.ts +3 -0
- package/src/generators/application/lib/enable-strict-type-checking.js +36 -0
- package/src/generators/application/lib/index.d.ts +12 -0
- package/src/generators/application/lib/index.js +15 -0
- package/src/generators/application/lib/normalize-options.d.ts +4 -0
- package/src/generators/application/lib/normalize-options.js +56 -0
- package/src/generators/application/lib/normalized-schema.d.ts +15 -0
- package/src/generators/application/lib/normalized-schema.js +2 -0
- package/src/generators/application/lib/set-app-strict-default.d.ts +2 -0
- package/src/generators/application/lib/set-app-strict-default.js +14 -0
- package/src/generators/application/lib/set-generator-defaults.d.ts +3 -0
- package/src/generators/application/lib/set-generator-defaults.js +17 -0
- package/src/generators/application/lib/update-editor-tsconfig.d.ts +3 -0
- package/src/generators/application/lib/update-editor-tsconfig.js +22 -0
- package/src/generators/application/schema.d.ts +34 -0
- package/src/generators/application/schema.json +192 -0
- package/src/generators/component/component.d.ts +5 -0
- package/src/generators/component/component.js +57 -0
- package/src/generators/component/files/__fileName__.__style__ +6 -0
- package/src/generators/component/files/__fileName__.html__tpl__ +1 -0
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +21 -0
- package/src/generators/component/files/__fileName__.ts__tpl__ +27 -0
- package/src/generators/component/lib/component.d.ts +3 -0
- package/src/generators/component/lib/component.js +46 -0
- package/src/generators/component/lib/index.d.ts +4 -0
- package/src/generators/component/lib/index.js +7 -0
- package/src/generators/component/lib/module.d.ts +3 -0
- package/src/generators/component/lib/module.js +63 -0
- package/src/generators/component/lib/normalize-options.d.ts +3 -0
- package/src/generators/component/lib/normalize-options.js +41 -0
- package/src/generators/component/lib/set-generator-defaults.d.ts +3 -0
- package/src/generators/component/lib/set-generator-defaults.js +14 -0
- package/src/generators/component/schema.d.ts +48 -0
- package/src/generators/component/schema.json +138 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +4 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.js +36 -0
- package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +17 -0
- package/src/generators/component-cypress-spec/lib/get-args-default-value.d.ts +2 -0
- package/src/generators/component-cypress-spec/lib/get-args-default-value.js +25 -0
- package/src/generators/component-cypress-spec/lib/get-component-selector.d.ts +2 -0
- package/src/generators/component-cypress-spec/lib/get-component-selector.js +24 -0
- package/src/generators/component-cypress-spec/schema.d.ts +10 -0
- package/src/generators/component-cypress-spec/schema.json +65 -0
- package/src/generators/component-story/component-story.d.ts +4 -0
- package/src/generators/component-story/component-story.js +28 -0
- package/src/generators/component-story/files/__componentFileName__.stories.ts__tmpl__ +31 -0
- package/src/generators/component-story/schema.d.ts +8 -0
- package/src/generators/component-story/schema.json +53 -0
- package/src/generators/component-test/component-test.d.ts +4 -0
- package/src/generators/component-test/component-test.js +31 -0
- package/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ +21 -0
- package/src/generators/component-test/schema.d.ts +12 -0
- package/src/generators/component-test/schema.json +49 -0
- package/src/generators/convert-to-application-executor/convert-to-application-executor.d.ts +4 -0
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +240 -0
- package/src/generators/convert-to-application-executor/schema.d.ts +4 -0
- package/src/generators/convert-to-application-executor/schema.json +26 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +4 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +32 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +5 -0
- package/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +448 -0
- package/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/check-name-matches.js +25 -0
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +50 -0
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +19 -0
- package/src/generators/convert-to-with-mf/lib/index.d.ts +6 -0
- package/src/generators/convert-to-with-mf/lib/index.js +9 -0
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +5 -0
- package/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +68 -0
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +2 -0
- package/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +14 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +3 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +51 -0
- package/src/generators/convert-to-with-mf/schema.d.ts +4 -0
- package/src/generators/convert-to-with-mf/schema.json +33 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +9 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +108 -0
- package/src/generators/cypress-component-configuration/schema.d.ts +6 -0
- package/src/generators/cypress-component-configuration/schema.json +40 -0
- package/src/generators/directive/directive.d.ts +4 -0
- package/src/generators/directive/directive.js +29 -0
- package/src/generators/directive/files/__fileName__.spec.ts__tpl__ +8 -0
- package/src/generators/directive/files/__fileName__.ts__tpl__ +9 -0
- package/src/generators/directive/lib/index.d.ts +1 -0
- package/src/generators/directive/lib/index.js +4 -0
- package/src/generators/directive/lib/normalize-options.d.ts +3 -0
- package/src/generators/directive/lib/normalize-options.js +37 -0
- package/src/generators/directive/schema.d.ts +35 -0
- package/src/generators/directive/schema.json +96 -0
- package/src/generators/federate-module/federate-module.d.ts +4 -0
- package/src/generators/federate-module/federate-module.js +40 -0
- package/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +2 -0
- package/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +15 -0
- package/src/generators/federate-module/lib/add-path-to-exposes.d.ts +8 -0
- package/src/generators/federate-module/lib/add-path-to-exposes.js +78 -0
- package/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +8 -0
- package/src/generators/federate-module/lib/add-path-to-ts-config.js +12 -0
- package/src/generators/federate-module/lib/add-remote.d.ts +7 -0
- package/src/generators/federate-module/lib/add-remote.js +45 -0
- package/src/generators/federate-module/lib/check-remote-exists.d.ts +2 -0
- package/src/generators/federate-module/lib/check-remote-exists.js +22 -0
- package/src/generators/federate-module/lib/index.d.ts +4 -0
- package/src/generators/federate-module/lib/index.js +7 -0
- package/src/generators/federate-module/schema.d.ts +15 -0
- package/src/generators/federate-module/schema.json +81 -0
- package/src/generators/host/files/common/pre-v17/src/main.server.ts__tmpl__ +66 -0
- package/src/generators/host/files/common/v17+/src/main.server.ts__tmpl__ +67 -0
- package/src/generators/host/files/js/webpack.server.config.js__tmpl__ +3 -0
- package/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +4 -0
- package/src/generators/host/host.d.ts +5 -0
- package/src/generators/host/host.js +101 -0
- package/src/generators/host/lib/index.d.ts +1 -0
- package/src/generators/host/lib/index.js +4 -0
- package/src/generators/host/lib/update-ssr-setup.d.ts +3 -0
- package/src/generators/host/lib/update-ssr-setup.js +40 -0
- package/src/generators/host/schema.d.ts +33 -0
- package/src/generators/host/schema.json +185 -0
- package/src/generators/init/init.d.ts +4 -0
- package/src/generators/init/init.js +65 -0
- package/src/generators/init/schema.d.ts +6 -0
- package/src/generators/init/schema.json +34 -0
- package/src/generators/library/files/base/README.md__tpl__ +9 -0
- package/src/generators/library/files/base/ng-package.json__tpl__ +7 -0
- package/src/generators/library/files/base/package.json__tpl__ +12 -0
- package/src/generators/library/files/base/tsconfig.json__tpl__ +14 -0
- package/src/generators/library/files/base/tsconfig.lib.json__tpl__ +17 -0
- package/src/generators/library/files/base/tsconfig.lib.prod.json__tpl__ +9 -0
- package/src/generators/library/files/ng-module/src/index.ts__tpl__ +2 -0
- package/src/generators/library/files/ng-module/src/lib/__libFileName__.module.ts__tpl__ +9 -0
- package/src/generators/library/files/ng-module/src/lib/lib.routes.ts__tpl__ +5 -0
- package/src/generators/library/files/standalone-components/src/index.ts__tpl__ +1 -0
- package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +6 -0
- package/src/generators/library/lib/add-children.d.ts +3 -0
- package/src/generators/library/lib/add-children.js +30 -0
- package/src/generators/library/lib/add-load-children.d.ts +3 -0
- package/src/generators/library/lib/add-load-children.js +22 -0
- package/src/generators/library/lib/add-module.d.ts +3 -0
- package/src/generators/library/lib/add-module.js +14 -0
- package/src/generators/library/lib/add-project.d.ts +4 -0
- package/src/generators/library/lib/add-project.js +41 -0
- package/src/generators/library/lib/add-standalone-component.d.ts +3 -0
- package/src/generators/library/lib/add-standalone-component.js +29 -0
- package/src/generators/library/lib/create-files.d.ts +4 -0
- package/src/generators/library/lib/create-files.js +53 -0
- package/src/generators/library/lib/enable-strict-type-checking.d.ts +7 -0
- package/src/generators/library/lib/enable-strict-type-checking.js +48 -0
- package/src/generators/library/lib/normalize-options.d.ts +4 -0
- package/src/generators/library/lib/normalize-options.js +77 -0
- package/src/generators/library/lib/normalized-schema.d.ts +55 -0
- package/src/generators/library/lib/normalized-schema.js +2 -0
- package/src/generators/library/lib/set-generator-defaults.d.ts +3 -0
- package/src/generators/library/lib/set-generator-defaults.js +15 -0
- package/src/generators/library/lib/update-lib-package-npm-scope.d.ts +3 -0
- package/src/generators/library/lib/update-lib-package-npm-scope.js +11 -0
- package/src/generators/library/lib/update-tsconfig.d.ts +3 -0
- package/src/generators/library/lib/update-tsconfig.js +37 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +125 -0
- package/src/generators/library/schema.d.ts +44 -0
- package/src/generators/library/schema.json +208 -0
- package/src/generators/library-secondary-entry-point/files/README.md__tmpl__ +3 -0
- package/src/generators/library-secondary-entry-point/files/ng-package.json__tmpl__ +5 -0
- package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +1 -0
- package/src/generators/library-secondary-entry-point/files/src/lib/__fileName__.module.ts__tmpl__ +7 -0
- package/src/generators/library-secondary-entry-point/lib/add-files.d.ts +3 -0
- package/src/generators/library-secondary-entry-point/lib/add-files.js +16 -0
- package/src/generators/library-secondary-entry-point/lib/add-path-mapping.d.ts +3 -0
- package/src/generators/library-secondary-entry-point/lib/add-path-mapping.js +16 -0
- package/src/generators/library-secondary-entry-point/lib/index.d.ts +4 -0
- package/src/generators/library-secondary-entry-point/lib/index.js +7 -0
- package/src/generators/library-secondary-entry-point/lib/normalize-options.d.ts +3 -0
- package/src/generators/library-secondary-entry-point/lib/normalize-options.js +31 -0
- package/src/generators/library-secondary-entry-point/lib/update-tsconfig-included-files.d.ts +3 -0
- package/src/generators/library-secondary-entry-point/lib/update-tsconfig-included-files.js +26 -0
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.d.ts +4 -0
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +16 -0
- package/src/generators/library-secondary-entry-point/schema.d.ts +16 -0
- package/src/generators/library-secondary-entry-point/schema.json +43 -0
- package/src/generators/move/lib/index.d.ts +3 -0
- package/src/generators/move/lib/index.js +6 -0
- package/src/generators/move/lib/types.d.ts +4 -0
- package/src/generators/move/lib/types.js +2 -0
- package/src/generators/move/lib/update-module-name.d.ts +11 -0
- package/src/generators/move/lib/update-module-name.js +99 -0
- package/src/generators/move/lib/update-ng-package.d.ts +3 -0
- package/src/generators/move/lib/update-ng-package.js +33 -0
- package/src/generators/move/lib/update-secondary-entry-points.d.ts +3 -0
- package/src/generators/move/lib/update-secondary-entry-points.js +44 -0
- package/src/generators/move/move-impl.d.ts +7 -0
- package/src/generators/move/move-impl.js +25 -0
- package/src/generators/move/move.d.ts +4 -0
- package/src/generators/move/move.js +16 -0
- package/src/generators/move/schema.d.ts +11 -0
- package/src/generators/move/schema.json +61 -0
- package/src/generators/ng-add/files/root/apps/__dot__gitkeep +0 -0
- package/src/generators/ng-add/files/root/libs/__dot__gitkeep +0 -0
- package/src/generators/ng-add/files/root/tools/generators/__dot__gitkeep +0 -0
- package/src/generators/ng-add/files/root/tools/tsconfig.tools.json__tmpl__ +12 -0
- package/src/generators/ng-add/files/root-karma/karma.conf.js__tmpl__ +43 -0
- package/src/generators/ng-add/migrate-from-angular-cli.d.ts +3 -0
- package/src/generators/ng-add/migrate-from-angular-cli.js +62 -0
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.d.ts +9 -0
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +78 -0
- package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.d.ts +10 -0
- package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.js +95 -0
- package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.d.ts +12 -0
- package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +113 -0
- package/src/generators/ng-add/migrators/builders/builder-migrator-class.type.d.ts +6 -0
- package/src/generators/ng-add/migrators/builders/builder-migrator-class.type.js +2 -0
- package/src/generators/ng-add/migrators/builders/builder.migrator.d.ts +13 -0
- package/src/generators/ng-add/migrators/builders/builder.migrator.js +43 -0
- package/src/generators/ng-add/migrators/builders/index.d.ts +5 -0
- package/src/generators/ng-add/migrators/builders/index.js +8 -0
- package/src/generators/ng-add/migrators/index.d.ts +2 -0
- package/src/generators/ng-add/migrators/index.js +5 -0
- package/src/generators/ng-add/migrators/migrator.d.ts +23 -0
- package/src/generators/ng-add/migrators/migrator.js +117 -0
- package/src/generators/ng-add/migrators/projects/app.migrator.d.ts +25 -0
- package/src/generators/ng-add/migrators/projects/app.migrator.js +342 -0
- package/src/generators/ng-add/migrators/projects/e2e.migrator.d.ts +38 -0
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +604 -0
- package/src/generators/ng-add/migrators/projects/index.d.ts +4 -0
- package/src/generators/ng-add/migrators/projects/index.js +7 -0
- package/src/generators/ng-add/migrators/projects/lib.migrator.d.ts +11 -0
- package/src/generators/ng-add/migrators/projects/lib.migrator.js +53 -0
- package/src/generators/ng-add/migrators/projects/project.migrator.d.ts +25 -0
- package/src/generators/ng-add/migrators/projects/project.migrator.js +180 -0
- package/src/generators/ng-add/ng-add.d.ts +4 -0
- package/src/generators/ng-add/ng-add.js +9 -0
- package/src/generators/ng-add/schema.d.ts +16 -0
- package/src/generators/ng-add/schema.json +66 -0
- package/src/generators/ng-add/utilities/dependencies.d.ts +2 -0
- package/src/generators/ng-add/utilities/dependencies.js +28 -0
- package/src/generators/ng-add/utilities/format-files-task.d.ts +2 -0
- package/src/generators/ng-add/utilities/format-files-task.js +16 -0
- package/src/generators/ng-add/utilities/index.d.ts +7 -0
- package/src/generators/ng-add/utilities/index.js +10 -0
- package/src/generators/ng-add/utilities/logger.d.ts +8 -0
- package/src/generators/ng-add/utilities/logger.js +20 -0
- package/src/generators/ng-add/utilities/projects.d.ts +4 -0
- package/src/generators/ng-add/utilities/projects.js +35 -0
- package/src/generators/ng-add/utilities/types.d.ts +31 -0
- package/src/generators/ng-add/utilities/types.js +2 -0
- package/src/generators/ng-add/utilities/validation-logging.d.ts +3 -0
- package/src/generators/ng-add/utilities/validation-logging.js +38 -0
- package/src/generators/ng-add/utilities/workspace.d.ts +17 -0
- package/src/generators/ng-add/utilities/workspace.js +292 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.actions.ts__tmpl__ +16 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +37 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.ts__tmpl__ +22 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +99 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.ts__tmpl__ +27 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.models.ts__tmpl__ +7 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.reducer.spec.ts__tmpl__ +37 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.reducer.ts__tmpl__ +41 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +58 -0
- package/src/generators/ngrx/files/__directory__/__fileName__.selectors.ts__tmpl__ +38 -0
- package/src/generators/ngrx/lib/add-exports-barrel.d.ts +6 -0
- package/src/generators/ngrx/lib/add-exports-barrel.js +45 -0
- package/src/generators/ngrx/lib/add-imports-to-module.d.ts +3 -0
- package/src/generators/ngrx/lib/add-imports-to-module.js +182 -0
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts +3 -0
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +25 -0
- package/src/generators/ngrx/lib/generate-files.d.ts +6 -0
- package/src/generators/ngrx/lib/generate-files.js +23 -0
- package/src/generators/ngrx/lib/index.d.ts +6 -0
- package/src/generators/ngrx/lib/index.js +15 -0
- package/src/generators/ngrx/lib/normalize-options.d.ts +7 -0
- package/src/generators/ngrx/lib/normalize-options.js +28 -0
- package/src/generators/ngrx/lib/validate-options.d.ts +3 -0
- package/src/generators/ngrx/lib/validate-options.js +15 -0
- package/src/generators/ngrx/ngrx.d.ts +4 -0
- package/src/generators/ngrx/ngrx.js +26 -0
- package/src/generators/ngrx/schema.d.ts +14 -0
- package/src/generators/ngrx/schema.json +102 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.actions.ts__tmpl__ +16 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +37 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.effects.ts__tmpl__ +22 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +99 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.facade.ts__tmpl__ +27 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.models.ts__tmpl__ +7 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.reducer.spec.ts__tmpl__ +37 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.reducer.ts__tmpl__ +41 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +58 -0
- package/src/generators/ngrx-feature-store/files/__directory__/__fileName__.selectors.ts__tmpl__ +38 -0
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.d.ts +3 -0
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +41 -0
- package/src/generators/ngrx-feature-store/lib/add-imports.d.ts +3 -0
- package/src/generators/ngrx-feature-store/lib/add-imports.js +102 -0
- package/src/generators/ngrx-feature-store/lib/add-ngrx-to-package-json.d.ts +3 -0
- package/src/generators/ngrx-feature-store/lib/add-ngrx-to-package-json.js +25 -0
- package/src/generators/ngrx-feature-store/lib/generate-files.d.ts +3 -0
- package/src/generators/ngrx-feature-store/lib/generate-files.js +24 -0
- package/src/generators/ngrx-feature-store/lib/index.d.ts +6 -0
- package/src/generators/ngrx-feature-store/lib/index.js +9 -0
- package/src/generators/ngrx-feature-store/lib/normalize-options.d.ts +8 -0
- package/src/generators/ngrx-feature-store/lib/normalize-options.js +38 -0
- package/src/generators/ngrx-feature-store/lib/validate-options.d.ts +3 -0
- package/src/generators/ngrx-feature-store/lib/validate-options.js +12 -0
- package/src/generators/ngrx-feature-store/ngrx-feature-store.d.ts +5 -0
- package/src/generators/ngrx-feature-store/ngrx-feature-store.js +26 -0
- package/src/generators/ngrx-feature-store/schema.d.ts +12 -0
- package/src/generators/ngrx-feature-store/schema.json +72 -0
- package/src/generators/ngrx-root-store/lib/add-imports.d.ts +3 -0
- package/src/generators/ngrx-root-store/lib/add-imports.js +101 -0
- package/src/generators/ngrx-root-store/lib/add-ngrx-to-package-json.d.ts +3 -0
- package/src/generators/ngrx-root-store/lib/add-ngrx-to-package-json.js +27 -0
- package/src/generators/ngrx-root-store/lib/index.d.ts +4 -0
- package/src/generators/ngrx-root-store/lib/index.js +7 -0
- package/src/generators/ngrx-root-store/lib/normalize-options.d.ts +7 -0
- package/src/generators/ngrx-root-store/lib/normalize-options.js +40 -0
- package/src/generators/ngrx-root-store/lib/validate-options.d.ts +3 -0
- package/src/generators/ngrx-root-store/lib/validate-options.js +17 -0
- package/src/generators/ngrx-root-store/ngrx-root-store.d.ts +5 -0
- package/src/generators/ngrx-root-store/ngrx-root-store.js +36 -0
- package/src/generators/ngrx-root-store/schema.d.ts +11 -0
- package/src/generators/ngrx-root-store/schema.json +71 -0
- package/src/generators/pipe/files/__fileName__.spec.ts__tpl__ +8 -0
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +11 -0
- package/src/generators/pipe/lib/index.d.ts +1 -0
- package/src/generators/pipe/lib/index.js +4 -0
- package/src/generators/pipe/lib/normalize-options.d.ts +3 -0
- package/src/generators/pipe/lib/normalize-options.js +31 -0
- package/src/generators/pipe/pipe.d.ts +4 -0
- package/src/generators/pipe/pipe.js +30 -0
- package/src/generators/pipe/schema.d.ts +33 -0
- package/src/generators/pipe/schema.json +77 -0
- package/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +3 -0
- package/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +4 -0
- package/src/generators/remote/files/common/pre-v17/src/main.server.ts__tmpl__ +72 -0
- package/src/generators/remote/files/common/v17+/src/main.server.ts__tmpl__ +73 -0
- package/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +7 -0
- package/src/generators/remote/lib/find-next-available-port.d.ts +2 -0
- package/src/generators/remote/lib/find-next-available-port.js +17 -0
- package/src/generators/remote/lib/index.d.ts +2 -0
- package/src/generators/remote/lib/index.js +5 -0
- package/src/generators/remote/lib/update-ssr-setup.d.ts +7 -0
- package/src/generators/remote/lib/update-ssr-setup.js +59 -0
- package/src/generators/remote/remote.d.ts +5 -0
- package/src/generators/remote/remote.js +79 -0
- package/src/generators/remote/schema.d.ts +32 -0
- package/src/generators/remote/schema.json +178 -0
- package/src/generators/scam/lib/convert-component-to-scam.d.ts +3 -0
- package/src/generators/scam/lib/convert-component-to-scam.js +44 -0
- package/src/generators/scam/lib/index.d.ts +2 -0
- package/src/generators/scam/lib/index.js +5 -0
- package/src/generators/scam/lib/normalize-options.d.ts +3 -0
- package/src/generators/scam/lib/normalize-options.js +33 -0
- package/src/generators/scam/scam.d.ts +4 -0
- package/src/generators/scam/scam.js +26 -0
- package/src/generators/scam/schema.d.ts +43 -0
- package/src/generators/scam/schema.json +142 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.d.ts +3 -0
- package/src/generators/scam-directive/lib/convert-directive-to-scam.js +44 -0
- package/src/generators/scam-directive/lib/index.d.ts +2 -0
- package/src/generators/scam-directive/lib/index.js +5 -0
- package/src/generators/scam-directive/lib/normalize-options.d.ts +3 -0
- package/src/generators/scam-directive/lib/normalize-options.js +32 -0
- package/src/generators/scam-directive/scam-directive.d.ts +4 -0
- package/src/generators/scam-directive/scam-directive.js +26 -0
- package/src/generators/scam-directive/schema.d.ts +35 -0
- package/src/generators/scam-directive/schema.json +96 -0
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.d.ts +3 -0
- package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +44 -0
- package/src/generators/scam-pipe/lib/index.d.ts +2 -0
- package/src/generators/scam-pipe/lib/index.js +5 -0
- package/src/generators/scam-pipe/lib/normalize-options.d.ts +3 -0
- package/src/generators/scam-pipe/lib/normalize-options.js +32 -0
- package/src/generators/scam-pipe/scam-pipe.d.ts +4 -0
- package/src/generators/scam-pipe/scam-pipe.js +26 -0
- package/src/generators/scam-pipe/schema.d.ts +33 -0
- package/src/generators/scam-pipe/schema.json +77 -0
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.d.ts +3 -0
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +33 -0
- package/src/generators/scam-to-standalone/lib/get-component-data-from-ast.d.ts +6 -0
- package/src/generators/scam-to-standalone/lib/get-component-data-from-ast.js +18 -0
- package/src/generators/scam-to-standalone/lib/get-module-metadata-from-ast.d.ts +9 -0
- package/src/generators/scam-to-standalone/lib/get-module-metadata-from-ast.js +64 -0
- package/src/generators/scam-to-standalone/lib/get-target-project.d.ts +2 -0
- package/src/generators/scam-to-standalone/lib/get-target-project.js +14 -0
- package/src/generators/scam-to-standalone/lib/index.d.ts +8 -0
- package/src/generators/scam-to-standalone/lib/index.js +11 -0
- package/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.d.ts +2 -0
- package/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.js +19 -0
- package/src/generators/scam-to-standalone/lib/selector-exists-in-ast.d.ts +2 -0
- package/src/generators/scam-to-standalone/lib/selector-exists-in-ast.js +8 -0
- package/src/generators/scam-to-standalone/lib/verify-is-inline-scam.d.ts +2 -0
- package/src/generators/scam-to-standalone/lib/verify-is-inline-scam.js +11 -0
- package/src/generators/scam-to-standalone/lib/verify-module-is-scam.d.ts +1 -0
- package/src/generators/scam-to-standalone/lib/verify-module-is-scam.js +12 -0
- package/src/generators/scam-to-standalone/scam-to-standalone.d.ts +4 -0
- package/src/generators/scam-to-standalone/scam-to-standalone.js +27 -0
- package/src/generators/scam-to-standalone/schema.d.ts +5 -0
- package/src/generators/scam-to-standalone/schema.json +32 -0
- package/src/generators/setup-mf/files/entry-module-files/entry.component.ts__tmpl__ +9 -0
- package/src/generators/setup-mf/files/entry-module-files/entry.module.ts__tmpl__ +18 -0
- package/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +4 -0
- package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +44 -0
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.component.ts__tmpl__ +13 -0
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +4 -0
- package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +24 -0
- package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +12 -0
- package/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +4 -0
- package/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +16 -0
- package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +20 -0
- package/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +3 -0
- package/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +15 -0
- package/src/generators/setup-mf/lib/add-cypress-workaround.d.ts +3 -0
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +52 -0
- package/src/generators/setup-mf/lib/add-remote-entry.d.ts +3 -0
- package/src/generators/setup-mf/lib/add-remote-entry.js +22 -0
- package/src/generators/setup-mf/lib/add-remote-to-host.d.ts +4 -0
- package/src/generators/setup-mf/lib/add-remote-to-host.js +108 -0
- package/src/generators/setup-mf/lib/change-build-target.d.ts +3 -0
- package/src/generators/setup-mf/lib/change-build-target.js +23 -0
- package/src/generators/setup-mf/lib/fix-bootstrap.d.ts +3 -0
- package/src/generators/setup-mf/lib/fix-bootstrap.js +33 -0
- package/src/generators/setup-mf/lib/generate-config.d.ts +6 -0
- package/src/generators/setup-mf/lib/generate-config.js +30 -0
- package/src/generators/setup-mf/lib/get-remotes-with-ports.d.ts +6 -0
- package/src/generators/setup-mf/lib/get-remotes-with-ports.js +21 -0
- package/src/generators/setup-mf/lib/index.d.ts +14 -0
- package/src/generators/setup-mf/lib/index.js +17 -0
- package/src/generators/setup-mf/lib/normalize-options.d.ts +3 -0
- package/src/generators/setup-mf/lib/normalize-options.js +14 -0
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +3 -0
- package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +56 -0
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.d.ts +3 -0
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +21 -0
- package/src/generators/setup-mf/lib/setup-serve-target.d.ts +3 -0
- package/src/generators/setup-mf/lib/setup-serve-target.js +39 -0
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +3 -0
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.js +16 -0
- package/src/generators/setup-mf/lib/update-host-app-routes.d.ts +3 -0
- package/src/generators/setup-mf/lib/update-host-app-routes.js +41 -0
- package/src/generators/setup-mf/lib/update-tsconfig.d.ts +3 -0
- package/src/generators/setup-mf/lib/update-tsconfig.js +19 -0
- package/src/generators/setup-mf/schema.d.ts +24 -0
- package/src/generators/setup-mf/schema.json +91 -0
- package/src/generators/setup-mf/setup-mf.d.ts +4 -0
- package/src/generators/setup-mf/setup-mf.js +39 -0
- package/src/generators/setup-ssr/files/ngmodule/base/src/__main__ +1 -0
- package/src/generators/setup-ssr/files/ngmodule/base/src/app/__rootModuleFileName__ +14 -0
- package/src/generators/setup-ssr/files/ngmodule/pre-v15-2/src/main.ts__tpl__ +14 -0
- package/src/generators/setup-ssr/files/root/tsconfig.server.json__tpl__ +15 -0
- package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +56 -0
- package/src/generators/setup-ssr/files/server/server-builder/pre-v17/__serverFileName__ +59 -0
- package/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ +69 -0
- package/src/generators/setup-ssr/files/standalone/src/__main__ +7 -0
- package/src/generators/setup-ssr/files/standalone/src/app/app.config.server.ts__tpl__ +11 -0
- package/src/generators/setup-ssr/lib/add-dependencies.d.ts +2 -0
- package/src/generators/setup-ssr/lib/add-dependencies.js +36 -0
- package/src/generators/setup-ssr/lib/add-hydration.d.ts +3 -0
- package/src/generators/setup-ssr/lib/add-hydration.js +36 -0
- package/src/generators/setup-ssr/lib/add-server-file.d.ts +3 -0
- package/src/generators/setup-ssr/lib/add-server-file.js +31 -0
- package/src/generators/setup-ssr/lib/constants.d.ts +3 -0
- package/src/generators/setup-ssr/lib/constants.js +6 -0
- package/src/generators/setup-ssr/lib/generate-files.d.ts +3 -0
- package/src/generators/setup-ssr/lib/generate-files.js +26 -0
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +4 -0
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +29 -0
- package/src/generators/setup-ssr/lib/index.d.ts +10 -0
- package/src/generators/setup-ssr/lib/index.js +13 -0
- package/src/generators/setup-ssr/lib/normalize-options.d.ts +14 -0
- package/src/generators/setup-ssr/lib/normalize-options.js +26 -0
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +3 -0
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.js +93 -0
- package/src/generators/setup-ssr/lib/update-app-module.d.ts +3 -0
- package/src/generators/setup-ssr/lib/update-app-module.js +27 -0
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +4 -0
- package/src/generators/setup-ssr/lib/update-project-config.js +127 -0
- package/src/generators/setup-ssr/lib/validate-options.d.ts +3 -0
- package/src/generators/setup-ssr/lib/validate-options.js +36 -0
- package/src/generators/setup-ssr/schema.d.ts +12 -0
- package/src/generators/setup-ssr/schema.json +68 -0
- package/src/generators/setup-ssr/setup-ssr.d.ts +4 -0
- package/src/generators/setup-ssr/setup-ssr.js +42 -0
- package/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ +18 -0
- package/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ +14 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.js +35 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-config.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-config.js +17 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.d.ts +2 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.js +14 -0
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.d.ts +2 -0
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.js +19 -0
- package/src/generators/setup-tailwind/lib/index.d.ts +6 -0
- package/src/generators/setup-tailwind/lib/index.js +9 -0
- package/src/generators/setup-tailwind/lib/normalize-options.d.ts +2 -0
- package/src/generators/setup-tailwind/lib/normalize-options.js +10 -0
- package/src/generators/setup-tailwind/lib/update-application-styles.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/update-application-styles.js +52 -0
- package/src/generators/setup-tailwind/schema.d.ts +11 -0
- package/src/generators/setup-tailwind/schema.json +42 -0
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +4 -0
- package/src/generators/setup-tailwind/setup-tailwind.js +29 -0
- package/src/generators/stories/lib/get-e2e-project.d.ts +2 -0
- package/src/generators/stories/lib/get-e2e-project.js +15 -0
- package/src/generators/stories/schema.d.ts +8 -0
- package/src/generators/stories/schema.json +64 -0
- package/src/generators/stories/stories.d.ts +4 -0
- package/src/generators/stories/stories.js +67 -0
- package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.d.ts +1 -0
- package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.js +15 -0
- package/src/generators/storybook-configuration/lib/generate-stories.d.ts +3 -0
- package/src/generators/storybook-configuration/lib/generate-stories.js +21 -0
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.d.ts +3 -0
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +22 -0
- package/src/generators/storybook-configuration/lib/validate-options.d.ts +2 -0
- package/src/generators/storybook-configuration/lib/validate-options.js +9 -0
- package/src/generators/storybook-configuration/schema.d.ts +15 -0
- package/src/generators/storybook-configuration/schema.json +98 -0
- package/src/generators/storybook-configuration/storybook-configuration.d.ts +4 -0
- package/src/generators/storybook-configuration/storybook-configuration.js +36 -0
- package/src/generators/utils/add-jest.d.ts +8 -0
- package/src/generators/utils/add-jest.js +36 -0
- package/src/generators/utils/add-mf-env-to-inputs.d.ts +2 -0
- package/src/generators/utils/add-mf-env-to-inputs.js +24 -0
- package/src/generators/utils/dependencies.d.ts +2 -0
- package/src/generators/utils/dependencies.js +14 -0
- package/src/generators/utils/ensure-angular-dependencies.d.ts +2 -0
- package/src/generators/utils/ensure-angular-dependencies.js +35 -0
- package/src/generators/utils/entry-point.d.ts +2 -0
- package/src/generators/utils/entry-point.js +20 -0
- package/src/generators/utils/export-scam.d.ts +10 -0
- package/src/generators/utils/export-scam.js +37 -0
- package/src/generators/utils/find-module.d.ts +4 -0
- package/src/generators/utils/find-module.js +64 -0
- package/src/generators/utils/index.d.ts +2 -0
- package/src/generators/utils/index.js +5 -0
- package/src/generators/utils/insert-ngmodule-import.d.ts +4 -0
- package/src/generators/utils/insert-ngmodule-import.js +139 -0
- package/src/generators/utils/path.d.ts +1 -0
- package/src/generators/utils/path.js +10 -0
- package/src/generators/utils/project.d.ts +2 -0
- package/src/generators/utils/project.js +8 -0
- package/src/generators/utils/selector.d.ts +3 -0
- package/src/generators/utils/selector.js +21 -0
- package/src/generators/utils/storybook-ast/component-info.d.ts +11 -0
- package/src/generators/utils/storybook-ast/component-info.js +167 -0
- package/src/generators/utils/storybook-ast/entry-point.d.ts +7 -0
- package/src/generators/utils/storybook-ast/entry-point.js +63 -0
- package/src/generators/utils/storybook-ast/module-info.d.ts +5 -0
- package/src/generators/utils/storybook-ast/module-info.js +220 -0
- package/src/generators/utils/storybook-ast/storybook-inputs.d.ts +12 -0
- package/src/generators/utils/storybook-ast/storybook-inputs.js +78 -0
- package/src/generators/utils/storybook-ast/tree-utilities.d.ts +2 -0
- package/src/generators/utils/storybook-ast/tree-utilities.js +31 -0
- package/src/generators/utils/testing.d.ts +10 -0
- package/src/generators/utils/testing.js +274 -0
- package/src/generators/utils/types.d.ts +1 -0
- package/src/generators/utils/types.js +2 -0
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.d.ts +2 -0
- package/src/generators/utils/update-app-editor-tsconfig-excluded-files.js +23 -0
- package/src/generators/utils/update-project-root-tsconfig.d.ts +3 -0
- package/src/generators/utils/update-project-root-tsconfig.js +26 -0
- package/src/generators/utils/validations.d.ts +2 -0
- package/src/generators/utils/validations.js +11 -0
- package/src/generators/utils/version-utils.d.ts +15 -0
- package/src/generators/utils/version-utils.js +66 -0
- package/src/generators/web-worker/files/config/tsconfig.worker.json__tpl__ +14 -0
- package/src/generators/web-worker/files/worker/__name__.worker.ts__tpl__ +6 -0
- package/src/generators/web-worker/lib/add-snippet.d.ts +2 -0
- package/src/generators/web-worker/lib/add-snippet.js +33 -0
- package/src/generators/web-worker/lib/index.d.ts +2 -0
- package/src/generators/web-worker/lib/index.js +5 -0
- package/src/generators/web-worker/lib/normalize-options.d.ts +3 -0
- package/src/generators/web-worker/lib/normalize-options.js +25 -0
- package/src/generators/web-worker/schema.d.ts +7 -0
- package/src/generators/web-worker/schema.json +48 -0
- package/src/generators/web-worker/web-worker.d.ts +4 -0
- package/src/generators/web-worker/web-worker.js +34 -0
- package/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.d.ts +2 -0
- package/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.js +23 -0
- package/src/migrations/update-14-2-0/update-angular-cli.d.ts +2 -0
- package/src/migrations/update-14-2-0/update-angular-cli.js +22 -0
- package/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.d.ts +2 -0
- package/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.js +34 -0
- package/src/migrations/update-14-2-0/update-ngcc-target.d.ts +2 -0
- package/src/migrations/update-14-2-0/update-ngcc-target.js +17 -0
- package/src/migrations/update-14-2-0/update-router-initial-navigation.d.ts +2 -0
- package/src/migrations/update-14-2-0/update-router-initial-navigation.js +70 -0
- package/src/migrations/update-14-2-0/update-tsconfig-target.d.ts +2 -0
- package/src/migrations/update-14-2-0/update-tsconfig-target.js +155 -0
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.d.ts +5 -0
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js +91 -0
- package/src/migrations/update-14-5-2/update-angular-cli.d.ts +2 -0
- package/src/migrations/update-14-5-2/update-angular-cli.js +22 -0
- package/src/migrations/update-14-6-0/update-angular-cli.d.ts +2 -0
- package/src/migrations/update-14-6-0/update-angular-cli.js +22 -0
- package/src/migrations/update-14-8-0/rename-webpack-server.d.ts +2 -0
- package/src/migrations/update-14-8-0/rename-webpack-server.js +21 -0
- package/src/migrations/update-15-0-0/add-karma-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-karma-inputs.js +41 -0
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.d.ts +2 -0
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +102 -0
- package/src/migrations/update-15-2-0/remove-browserlist-config.d.ts +3 -0
- package/src/migrations/update-15-2-0/remove-browserlist-config.js +58 -0
- package/src/migrations/update-15-2-0/remove-platform-server-exports.d.ts +2 -0
- package/src/migrations/update-15-2-0/remove-platform-server-exports.js +61 -0
- package/src/migrations/update-15-2-0/update-angular-cli.d.ts +2 -0
- package/src/migrations/update-15-2-0/update-angular-cli.js +22 -0
- package/src/migrations/update-15-2-0/update-karma-main-file.d.ts +2 -0
- package/src/migrations/update-15-2-0/update-karma-main-file.js +71 -0
- package/src/migrations/update-15-2-0/update-typescript-target.d.ts +2 -0
- package/src/migrations/update-15-2-0/update-typescript-target.js +52 -0
- package/src/migrations/update-15-2-0/update-workspace-config.d.ts +2 -0
- package/src/migrations/update-15-2-0/update-workspace-config.js +24 -0
- package/src/migrations/update-15-5-0/update-angular-cli.d.ts +2 -0
- package/src/migrations/update-15-5-0/update-angular-cli.js +22 -0
- package/src/migrations/update-15-7-0/install-required-packages.d.ts +2 -0
- package/src/migrations/update-15-7-0/install-required-packages.js +36 -0
- package/src/migrations/update-15-8-0/update-angular-cli.d.ts +2 -0
- package/src/migrations/update-15-8-0/update-angular-cli.js +22 -0
- package/src/migrations/update-15-9-0/update-file-server-executor.d.ts +2 -0
- package/src/migrations/update-15-9-0/update-file-server-executor.js +42 -0
- package/src/migrations/update-15-9-0/update-testing-tsconfig.d.ts +3 -0
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js +33 -0
- package/src/migrations/update-16-0-0/remove-karma-defaults.d.ts +2 -0
- package/src/migrations/update-16-0-0/remove-karma-defaults.js +52 -0
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.d.ts +2 -0
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +40 -0
- package/src/migrations/update-16-0-0/remove-protractor-defaults.d.ts +2 -0
- package/src/migrations/update-16-0-0/remove-protractor-defaults.js +52 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.d.ts +2 -0
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +127 -0
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.d.ts +2 -0
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +22 -0
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.d.ts +2 -0
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +61 -0
- package/src/migrations/update-16-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-16-1-0/update-angular-cli.js +23 -0
- package/src/migrations/update-16-1-0/update-server-executor-config.d.ts +2 -0
- package/src/migrations/update-16-1-0/update-server-executor-config.js +26 -0
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts +2 -0
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +122 -0
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts +2 -0
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +34 -0
- package/src/migrations/update-16-4-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-16-4-0/update-angular-cli.js +23 -0
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts +2 -0
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +34 -0
- package/src/migrations/update-16-7-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-16-7-0/update-angular-cli.js +23 -0
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts +3 -0
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +50 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.d.ts +2 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-builders.js +75 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.d.ts +2 -0
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +183 -0
- package/src/migrations/update-17-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-17-1-0/update-angular-cli.js +23 -0
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.d.ts +2 -0
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +37 -0
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts +2 -0
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +40 -0
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.d.ts +2 -0
- package/src/migrations/update-17-3-0/add-autoprefixer-dependency.js +26 -0
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.d.ts +2 -0
- package/src/migrations/update-17-3-0/add-browser-sync-dependency.js +26 -0
- package/src/migrations/update-17-3-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-17-3-0/update-angular-cli.js +23 -0
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +2 -0
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +26 -0
- package/src/migrations/update-18-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-18-1-0/update-angular-cli.js +23 -0
- package/src/migrations/utils/projects.d.ts +5 -0
- package/src/migrations/utils/projects.js +15 -0
- package/src/runtime/nx/data-persistence.d.ts +271 -0
- package/src/runtime/nx/data-persistence.js +350 -0
- package/src/utils/backward-compatible-versions.d.ts +8 -0
- package/src/utils/backward-compatible-versions.js +59 -0
- package/src/utils/cli-config-utils.d.ts +1 -0
- package/src/utils/cli-config-utils.js +45 -0
- package/src/utils/file-change-recorder.d.ts +17 -0
- package/src/utils/file-change-recorder.js +39 -0
- package/src/utils/get-mf-projects.d.ts +4 -0
- package/src/utils/get-mf-projects.js +34 -0
- package/src/utils/mf/utils.d.ts +15 -0
- package/src/utils/mf/utils.js +100 -0
- package/src/utils/mf/with-module-federation-ssr.d.ts +2 -0
- package/src/utils/mf/with-module-federation-ssr.js +46 -0
- package/src/utils/mf/with-module-federation.d.ts +2 -0
- package/src/utils/mf/with-module-federation.js +48 -0
- package/src/utils/nx-devkit/ast-utils.d.ts +94 -0
- package/src/utils/nx-devkit/ast-utils.js +596 -0
- package/src/utils/nx-devkit/route-utils.d.ts +19 -0
- package/src/utils/nx-devkit/route-utils.js +102 -0
- package/src/utils/nx-devkit/testing.d.ts +14 -0
- package/src/utils/nx-devkit/testing.js +84 -0
- package/src/utils/public-api.d.ts +2 -0
- package/src/utils/public-api.js +16 -0
- package/src/utils/targets.d.ts +2 -0
- package/src/utils/targets.js +17 -0
- package/src/utils/test-runners.d.ts +9 -0
- package/src/utils/test-runners.js +14 -0
- package/src/utils/types.d.ts +4 -0
- package/src/utils/types.js +2 -0
- package/src/utils/version-utils.d.ts +3 -0
- package/src/utils/version-utils.js +19 -0
- package/src/utils/versions.d.ts +25 -0
- package/src/utils/versions.js +28 -0
- package/tailwind.d.ts +6 -0
- package/tailwind.js +29 -0
- package/testing/index.d.ts +1 -0
- package/testing/index.js +6 -0
- package/testing/ng-package.json +6 -0
- package/testing/src/testing-utils.d.ts +31 -0
- package/testing/src/testing-utils.js +40 -0
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTsSourceFile = exports.getDecoratorPropertyValueNode = exports.readBootstrapInfo = exports.addEntryComponents = exports.addDeclarationToModule = exports.addProviderToComponent = exports.addProviderToModule = exports.addProviderToAppConfig = exports.addProviderToBootstrapApplication = exports.isNgStandaloneApp = exports.addRouteToNgModule = exports.getBootstrapComponent = exports.replaceIntoToTestBed = exports.addDeclarationsToTestBed = exports.addImportToTestBed = exports.addImportToModule = exports.addImportToPipe = exports.addImportToDirective = exports.addImportToComponent = exports.removeFromNgModule = exports.getDecoratorMetadata = exports.isStandalone = void 0;
|
|
4
|
+
const js_1 = require("@nx/js");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
8
|
+
let tsModule;
|
|
9
|
+
function _angularImportsFromNode(node, _sourceFile) {
|
|
10
|
+
if (!tsModule) {
|
|
11
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
12
|
+
}
|
|
13
|
+
const ms = node.moduleSpecifier;
|
|
14
|
+
let modulePath;
|
|
15
|
+
switch (ms.kind) {
|
|
16
|
+
case tsModule.SyntaxKind.StringLiteral:
|
|
17
|
+
modulePath = ms.text;
|
|
18
|
+
break;
|
|
19
|
+
default:
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
if (!modulePath.startsWith('@angular/')) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
if (node.importClause) {
|
|
26
|
+
if (node.importClause.name) {
|
|
27
|
+
// This is of the form `import Name from 'path'`. Ignore.
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
else if (node.importClause.namedBindings) {
|
|
31
|
+
const nb = node.importClause.namedBindings;
|
|
32
|
+
if (nb.kind == tsModule.SyntaxKind.NamespaceImport) {
|
|
33
|
+
// This is of the form `import * as name from 'path'`. Return `name.`.
|
|
34
|
+
return {
|
|
35
|
+
[`${nb.name.text}.`]: modulePath,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// This is of the form `import {a,b,c} from 'path'`
|
|
40
|
+
const namedImports = nb;
|
|
41
|
+
return namedImports.elements
|
|
42
|
+
.map((is) => is.propertyName ? is.propertyName.text : is.name.text)
|
|
43
|
+
.reduce((acc, curr) => {
|
|
44
|
+
acc[curr] = modulePath;
|
|
45
|
+
return acc;
|
|
46
|
+
}, {});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
// This is of the form `import 'path';`. Nothing to do.
|
|
53
|
+
return {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if the Component, Directive or Pipe is standalone
|
|
58
|
+
* @param sourceFile TS Source File containing the token to check
|
|
59
|
+
* @param decoratorName The type of decorator to check (Component, Directive, Pipe)
|
|
60
|
+
*/
|
|
61
|
+
function isStandalone(sourceFile, decoratorName) {
|
|
62
|
+
const decoratorMetadata = getDecoratorMetadata(sourceFile, decoratorName, '@angular/core');
|
|
63
|
+
return decoratorMetadata.some((node) => node.getText().includes('standalone: true'));
|
|
64
|
+
}
|
|
65
|
+
exports.isStandalone = isStandalone;
|
|
66
|
+
function getDecoratorMetadata(source, identifier, module) {
|
|
67
|
+
if (!tsModule) {
|
|
68
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
69
|
+
}
|
|
70
|
+
const angularImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration)
|
|
71
|
+
.map((node) => _angularImportsFromNode(node, source))
|
|
72
|
+
.reduce((acc, current) => {
|
|
73
|
+
for (const key of Object.keys(current)) {
|
|
74
|
+
acc[key] = current[key];
|
|
75
|
+
}
|
|
76
|
+
return acc;
|
|
77
|
+
}, {});
|
|
78
|
+
return (0, js_1.getSourceNodes)(source)
|
|
79
|
+
.filter((node) => {
|
|
80
|
+
return (node.kind == tsModule.SyntaxKind.Decorator &&
|
|
81
|
+
node.expression.kind ==
|
|
82
|
+
tsModule.SyntaxKind.CallExpression);
|
|
83
|
+
})
|
|
84
|
+
.map((node) => node.expression)
|
|
85
|
+
.filter((expr) => {
|
|
86
|
+
if (expr.expression.kind == tsModule.SyntaxKind.Identifier) {
|
|
87
|
+
const id = expr.expression;
|
|
88
|
+
return (id.getFullText(source) == identifier &&
|
|
89
|
+
angularImports[id.getFullText(source)] === module);
|
|
90
|
+
}
|
|
91
|
+
else if (expr.expression.kind == tsModule.SyntaxKind.PropertyAccessExpression) {
|
|
92
|
+
// This covers foo.NgModule when importing * as foo.
|
|
93
|
+
const paExpr = expr.expression;
|
|
94
|
+
// If the left expression is not an identifier, just give up at that point.
|
|
95
|
+
if (paExpr.expression.kind !== tsModule.SyntaxKind.Identifier) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
const id = paExpr.name.text;
|
|
99
|
+
const moduleId = paExpr.expression.getText(source);
|
|
100
|
+
return id === identifier && angularImports[`${moduleId}.`] === module;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
})
|
|
104
|
+
.filter((expr) => expr.arguments[0] &&
|
|
105
|
+
expr.arguments[0].kind == tsModule.SyntaxKind.ObjectLiteralExpression)
|
|
106
|
+
.map((expr) => expr.arguments[0]);
|
|
107
|
+
}
|
|
108
|
+
exports.getDecoratorMetadata = getDecoratorMetadata;
|
|
109
|
+
function _addSymbolToDecoratorMetadata(host, source, filePath, metadataField, expression, decoratorName) {
|
|
110
|
+
const nodes = getDecoratorMetadata(source, decoratorName, '@angular/core');
|
|
111
|
+
let node = nodes[0];
|
|
112
|
+
// Find the decorator declaration.
|
|
113
|
+
if (!node) {
|
|
114
|
+
return source;
|
|
115
|
+
}
|
|
116
|
+
if (!tsModule) {
|
|
117
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
118
|
+
}
|
|
119
|
+
// Get all the children property assignment of object literals.
|
|
120
|
+
const matchingProperties = node.properties
|
|
121
|
+
.filter((prop) => prop.kind == tsModule.SyntaxKind.PropertyAssignment)
|
|
122
|
+
// Filter out every fields that's not "metadataField". Also handles string literals
|
|
123
|
+
// (but not expressions).
|
|
124
|
+
.filter((prop) => {
|
|
125
|
+
const name = prop.name;
|
|
126
|
+
switch (name.kind) {
|
|
127
|
+
case tsModule.SyntaxKind.Identifier:
|
|
128
|
+
return name.getText(source) == metadataField;
|
|
129
|
+
case tsModule.SyntaxKind.StringLiteral:
|
|
130
|
+
return name.text == metadataField;
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
});
|
|
134
|
+
// Get the last node of the array literal.
|
|
135
|
+
if (!matchingProperties) {
|
|
136
|
+
return source;
|
|
137
|
+
}
|
|
138
|
+
if (matchingProperties.length == 0) {
|
|
139
|
+
// We haven't found the field in the metadata declaration. Insert a new field.
|
|
140
|
+
const expr = node;
|
|
141
|
+
let position;
|
|
142
|
+
let toInsert;
|
|
143
|
+
if (expr.properties.length == 0) {
|
|
144
|
+
position = expr.getEnd() - 1;
|
|
145
|
+
toInsert = ` ${metadataField}: [${expression}]\n`;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
node = expr.properties[expr.properties.length - 1];
|
|
149
|
+
position = node.getEnd();
|
|
150
|
+
// Get the indentation of the last element, if any.
|
|
151
|
+
const text = node.getFullText(source);
|
|
152
|
+
if (text.match('^\r?\r?\n')) {
|
|
153
|
+
toInsert = `,${text.match(/^\r?\n\s+/)[0]}${metadataField}: [${expression}]`;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
toInsert = `, ${metadataField}: [${expression}]`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return (0, js_1.insertChange)(host, source, filePath, position, toInsert);
|
|
160
|
+
}
|
|
161
|
+
const assignment = matchingProperties[0];
|
|
162
|
+
// If it's not an array, nothing we can do really.
|
|
163
|
+
if (assignment.initializer.kind !== tsModule.SyntaxKind.ArrayLiteralExpression) {
|
|
164
|
+
return source;
|
|
165
|
+
}
|
|
166
|
+
const arrLiteral = assignment.initializer;
|
|
167
|
+
if (arrLiteral.elements.length == 0) {
|
|
168
|
+
// Forward the property.
|
|
169
|
+
node = arrLiteral;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
node = arrLiteral.elements;
|
|
173
|
+
}
|
|
174
|
+
if (!node) {
|
|
175
|
+
console.log('No app module found. Please add your new class to your component.');
|
|
176
|
+
return source;
|
|
177
|
+
}
|
|
178
|
+
const isArray = Array.isArray(node);
|
|
179
|
+
if (isArray) {
|
|
180
|
+
const nodeArray = node;
|
|
181
|
+
const symbolsArray = nodeArray.map((node) => node.getText());
|
|
182
|
+
if (symbolsArray.includes(expression)) {
|
|
183
|
+
return source;
|
|
184
|
+
}
|
|
185
|
+
node = node[node.length - 1];
|
|
186
|
+
}
|
|
187
|
+
let toInsert;
|
|
188
|
+
let position = node.getEnd();
|
|
189
|
+
if (!isArray && node.kind == tsModule.SyntaxKind.ObjectLiteralExpression) {
|
|
190
|
+
// We haven't found the field in the metadata declaration. Insert a new
|
|
191
|
+
// field.
|
|
192
|
+
const expr = node;
|
|
193
|
+
if (expr.properties.length == 0) {
|
|
194
|
+
position = expr.getEnd() - 1;
|
|
195
|
+
toInsert = ` ${metadataField}: [${expression}]\n`;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
node = expr.properties[expr.properties.length - 1];
|
|
199
|
+
position = node.getEnd();
|
|
200
|
+
// Get the indentation of the last element, if any.
|
|
201
|
+
const text = node.getFullText(source);
|
|
202
|
+
if (text.match('^\r?\r?\n')) {
|
|
203
|
+
toInsert = `,${text.match(/^\r?\n\s+/)[0]}${metadataField}: [${expression}]`;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
toInsert = `, ${metadataField}: [${expression}]`;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else if (!isArray &&
|
|
211
|
+
node.kind == tsModule.SyntaxKind.ArrayLiteralExpression) {
|
|
212
|
+
// We found the field but it's empty. Insert it just before the `]`.
|
|
213
|
+
position--;
|
|
214
|
+
toInsert = `${expression}`;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
// Get the indentation of the last element, if any.
|
|
218
|
+
const text = node.getFullText(source);
|
|
219
|
+
if (text.match(/^\r?\n/)) {
|
|
220
|
+
toInsert = `,${text.match(/^\r?\n(\r?)\s+/)[0]}${expression}`;
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
toInsert = `, ${expression}`;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return (0, js_1.insertChange)(host, source, filePath, position, toInsert);
|
|
227
|
+
}
|
|
228
|
+
function _addSymbolToNgModuleMetadata(host, source, ngModulePath, metadataField, expression) {
|
|
229
|
+
return _addSymbolToDecoratorMetadata(host, source, ngModulePath, metadataField, expression, 'NgModule');
|
|
230
|
+
}
|
|
231
|
+
function removeFromNgModule(host, source, modulePath, property) {
|
|
232
|
+
const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
|
|
233
|
+
let node = nodes[0];
|
|
234
|
+
// Find the decorator declaration.
|
|
235
|
+
if (!node) {
|
|
236
|
+
return source;
|
|
237
|
+
}
|
|
238
|
+
// Get all the children property assignment of object literals.
|
|
239
|
+
const matchingProperty = getMatchingProperty(source, property, 'NgModule', '@angular/core');
|
|
240
|
+
if (matchingProperty) {
|
|
241
|
+
return (0, js_1.removeChange)(host, source, modulePath, matchingProperty.getStart(source), matchingProperty.getFullText(source));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
exports.removeFromNgModule = removeFromNgModule;
|
|
245
|
+
/**
|
|
246
|
+
* Add an import to a Standalone Component
|
|
247
|
+
* @param host Virtual Tree
|
|
248
|
+
* @param source TS Source File containing the Component
|
|
249
|
+
* @param componentPath The path to the Component
|
|
250
|
+
* @param symbolName The import to add to the Component
|
|
251
|
+
*/
|
|
252
|
+
function addImportToComponent(host, source, componentPath, symbolName) {
|
|
253
|
+
return _addSymbolToDecoratorMetadata(host, source, componentPath, 'imports', symbolName, 'Component');
|
|
254
|
+
}
|
|
255
|
+
exports.addImportToComponent = addImportToComponent;
|
|
256
|
+
/**
|
|
257
|
+
* Add an import to a Standalone Directive
|
|
258
|
+
* @param host Virtual Tree
|
|
259
|
+
* @param source TS Source File containing the Directive
|
|
260
|
+
* @param directivePath The path to the Directive
|
|
261
|
+
* @param symbolName The import to add to the Directive
|
|
262
|
+
*/
|
|
263
|
+
function addImportToDirective(host, source, directivePath, symbolName) {
|
|
264
|
+
return _addSymbolToDecoratorMetadata(host, source, directivePath, 'imports', symbolName, 'Directive');
|
|
265
|
+
}
|
|
266
|
+
exports.addImportToDirective = addImportToDirective;
|
|
267
|
+
/**
|
|
268
|
+
* Add an import to a Standalone Pipe
|
|
269
|
+
* @param host Virtual Tree
|
|
270
|
+
* @param source TS Source File containing the Pipe
|
|
271
|
+
* @param pipePath The path to the Pipe
|
|
272
|
+
* @param symbolName The import to add to the Pipe
|
|
273
|
+
*/
|
|
274
|
+
function addImportToPipe(host, source, pipePath, symbolName) {
|
|
275
|
+
return _addSymbolToDecoratorMetadata(host, source, pipePath, 'imports', symbolName, 'Pipe');
|
|
276
|
+
}
|
|
277
|
+
exports.addImportToPipe = addImportToPipe;
|
|
278
|
+
/**
|
|
279
|
+
* Add an import to an NgModule
|
|
280
|
+
* @param host Virtual Tree
|
|
281
|
+
* @param source TS Source File containing the NgModule
|
|
282
|
+
* @param modulePath The path to the NgModule
|
|
283
|
+
* @param symbolName The import to add to the NgModule
|
|
284
|
+
*/
|
|
285
|
+
function addImportToModule(host, source, modulePath, symbolName) {
|
|
286
|
+
return _addSymbolToNgModuleMetadata(host, source, modulePath, 'imports', symbolName);
|
|
287
|
+
}
|
|
288
|
+
exports.addImportToModule = addImportToModule;
|
|
289
|
+
function addImportToTestBed(host, source, specPath, symbolName) {
|
|
290
|
+
if (!tsModule) {
|
|
291
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
292
|
+
}
|
|
293
|
+
const allCalls = ((0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression));
|
|
294
|
+
const configureTestingModuleObjectLiterals = allCalls
|
|
295
|
+
.filter((c) => c.expression.kind === tsModule.SyntaxKind.PropertyAccessExpression)
|
|
296
|
+
.filter((c) => c.expression.name.getText(source) === 'configureTestingModule')
|
|
297
|
+
.map((c) => c.arguments[0].kind === tsModule.SyntaxKind.ObjectLiteralExpression
|
|
298
|
+
? c.arguments[0]
|
|
299
|
+
: null);
|
|
300
|
+
if (configureTestingModuleObjectLiterals.length > 0) {
|
|
301
|
+
const startPosition = configureTestingModuleObjectLiterals[0]
|
|
302
|
+
.getFirstToken(source)
|
|
303
|
+
.getEnd();
|
|
304
|
+
return (0, js_1.insertChange)(host, source, specPath, startPosition, `imports: [${symbolName}], `);
|
|
305
|
+
}
|
|
306
|
+
return source;
|
|
307
|
+
}
|
|
308
|
+
exports.addImportToTestBed = addImportToTestBed;
|
|
309
|
+
function addDeclarationsToTestBed(host, source, specPath, symbolName) {
|
|
310
|
+
if (!tsModule) {
|
|
311
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
312
|
+
}
|
|
313
|
+
const allCalls = ((0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression));
|
|
314
|
+
const configureTestingModuleObjectLiterals = allCalls
|
|
315
|
+
.filter((c) => c.expression.kind === tsModule.SyntaxKind.PropertyAccessExpression)
|
|
316
|
+
.filter((c) => c.expression.name.getText(source) === 'configureTestingModule')
|
|
317
|
+
.map((c) => c.arguments[0].kind === tsModule.SyntaxKind.ObjectLiteralExpression
|
|
318
|
+
? c.arguments[0]
|
|
319
|
+
: null);
|
|
320
|
+
if (configureTestingModuleObjectLiterals.length > 0) {
|
|
321
|
+
const startPosition = configureTestingModuleObjectLiterals[0]
|
|
322
|
+
.getFirstToken(source)
|
|
323
|
+
.getEnd();
|
|
324
|
+
return (0, js_1.insertChange)(host, source, specPath, startPosition, `declarations: [${symbolName.join(',')}], `);
|
|
325
|
+
}
|
|
326
|
+
return source;
|
|
327
|
+
}
|
|
328
|
+
exports.addDeclarationsToTestBed = addDeclarationsToTestBed;
|
|
329
|
+
function replaceIntoToTestBed(host, source, specPath, newSymbol, previousSymbol) {
|
|
330
|
+
if (!tsModule) {
|
|
331
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
332
|
+
}
|
|
333
|
+
const allCalls = ((0, js_1.findNodes)(source, tsModule.SyntaxKind.CallExpression));
|
|
334
|
+
const configureTestingModuleObjectLiterals = allCalls
|
|
335
|
+
.filter((c) => c.expression.kind === tsModule.SyntaxKind.PropertyAccessExpression)
|
|
336
|
+
.filter((c) => c.expression.name.getText(source) === 'configureTestingModule')
|
|
337
|
+
.map((c) => c.arguments[0].kind === tsModule.SyntaxKind.ObjectLiteralExpression
|
|
338
|
+
? c.arguments[0]
|
|
339
|
+
: null);
|
|
340
|
+
if (configureTestingModuleObjectLiterals.length > 0) {
|
|
341
|
+
const startPosition = configureTestingModuleObjectLiterals[0]
|
|
342
|
+
.getFirstToken(source)
|
|
343
|
+
.getEnd();
|
|
344
|
+
return (0, js_1.replaceChange)(host, source, specPath, startPosition, newSymbol, previousSymbol);
|
|
345
|
+
}
|
|
346
|
+
return source;
|
|
347
|
+
}
|
|
348
|
+
exports.replaceIntoToTestBed = replaceIntoToTestBed;
|
|
349
|
+
function getBootstrapComponent(source, moduleClassName) {
|
|
350
|
+
const bootstrap = getMatchingProperty(source, 'bootstrap', 'NgModule', '@angular/core');
|
|
351
|
+
if (!bootstrap) {
|
|
352
|
+
throw new Error(`Cannot find bootstrap components in '${moduleClassName}'`);
|
|
353
|
+
}
|
|
354
|
+
const c = bootstrap.getChildren();
|
|
355
|
+
const nodes = c[c.length - 1].getChildren();
|
|
356
|
+
const bootstrapComponent = nodes.slice(1, nodes.length - 1)[0];
|
|
357
|
+
if (!bootstrapComponent) {
|
|
358
|
+
throw new Error(`Cannot find bootstrap components in '${moduleClassName}'`);
|
|
359
|
+
}
|
|
360
|
+
return bootstrapComponent.getText();
|
|
361
|
+
}
|
|
362
|
+
exports.getBootstrapComponent = getBootstrapComponent;
|
|
363
|
+
function getMatchingProperty(source, property, identifier, module) {
|
|
364
|
+
const nodes = getDecoratorMetadata(source, identifier, module);
|
|
365
|
+
let node = nodes[0];
|
|
366
|
+
if (!node)
|
|
367
|
+
return null;
|
|
368
|
+
// Get all the children property assignment of object literals.
|
|
369
|
+
return getMatchingObjectLiteralElement(node, source, property);
|
|
370
|
+
}
|
|
371
|
+
function addRouteToNgModule(host, ngModulePath, source, route) {
|
|
372
|
+
const routes = getListOfRoutes(source);
|
|
373
|
+
if (!routes)
|
|
374
|
+
return source;
|
|
375
|
+
if (routes.hasTrailingComma || routes.length === 0) {
|
|
376
|
+
return (0, js_1.insertChange)(host, source, ngModulePath, routes.end, route);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
return (0, js_1.insertChange)(host, source, ngModulePath, routes.end, `, ${route}`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
exports.addRouteToNgModule = addRouteToNgModule;
|
|
383
|
+
function getListOfRoutes(source) {
|
|
384
|
+
if (!tsModule) {
|
|
385
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
386
|
+
}
|
|
387
|
+
const imports = getMatchingProperty(source, 'imports', 'NgModule', '@angular/core');
|
|
388
|
+
if (imports?.initializer.kind === tsModule.SyntaxKind.ArrayLiteralExpression) {
|
|
389
|
+
const a = imports.initializer;
|
|
390
|
+
for (const e of a.elements) {
|
|
391
|
+
if (e.kind === tsModule.SyntaxKind.CallExpression) {
|
|
392
|
+
const ee = e;
|
|
393
|
+
const text = ee.expression.getText(source);
|
|
394
|
+
if ((text === 'RouterModule.forRoot' ||
|
|
395
|
+
text === 'RouterModule.forChild') &&
|
|
396
|
+
ee.arguments.length > 0) {
|
|
397
|
+
const routes = ee.arguments[0];
|
|
398
|
+
if (routes.kind === tsModule.SyntaxKind.ArrayLiteralExpression) {
|
|
399
|
+
return routes.elements;
|
|
400
|
+
}
|
|
401
|
+
else if (routes.kind === tsModule.SyntaxKind.Identifier) {
|
|
402
|
+
// find the array expression
|
|
403
|
+
const variableDeclarations = (0, js_1.findNodes)(source, tsModule.SyntaxKind.VariableDeclaration);
|
|
404
|
+
const routesDeclaration = variableDeclarations.find((x) => {
|
|
405
|
+
return x.name.getText() === routes.getText();
|
|
406
|
+
});
|
|
407
|
+
if (routesDeclaration) {
|
|
408
|
+
return routesDeclaration.initializer.elements;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
function isNgStandaloneApp(tree, projectName) {
|
|
418
|
+
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
419
|
+
const mainFile = project.targets?.build?.options?.main ??
|
|
420
|
+
project.targets?.build?.options?.browser;
|
|
421
|
+
if (project.projectType !== 'application' || !mainFile) {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
(0, ensure_typescript_1.ensureTypescript)();
|
|
425
|
+
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
426
|
+
const mainFileContents = tree.read(mainFile, 'utf-8');
|
|
427
|
+
const BOOTSTRAP_APPLICATION_SELECTOR = 'CallExpression:has(Identifier[name=bootstrapApplication])';
|
|
428
|
+
const ast = tsquery.ast(mainFileContents);
|
|
429
|
+
const nodes = tsquery(ast, BOOTSTRAP_APPLICATION_SELECTOR, {
|
|
430
|
+
visitAllChildren: true,
|
|
431
|
+
});
|
|
432
|
+
return nodes.length > 0;
|
|
433
|
+
}
|
|
434
|
+
exports.isNgStandaloneApp = isNgStandaloneApp;
|
|
435
|
+
/**
|
|
436
|
+
* Add a provider to bootstrapApplication call for Standalone Applications
|
|
437
|
+
* @param tree Virtual Tree
|
|
438
|
+
* @param filePath Path to the file containing the bootstrapApplication call
|
|
439
|
+
* @param providerToAdd Provider to add
|
|
440
|
+
*/
|
|
441
|
+
function addProviderToBootstrapApplication(tree, filePath, providerToAdd) {
|
|
442
|
+
(0, ensure_typescript_1.ensureTypescript)();
|
|
443
|
+
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
444
|
+
const PROVIDERS_ARRAY_SELECTOR = 'CallExpression:has(Identifier[name=bootstrapApplication]) ObjectLiteralExpression > PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression';
|
|
445
|
+
const fileContents = tree.read(filePath, 'utf-8');
|
|
446
|
+
const ast = tsquery.ast(fileContents);
|
|
447
|
+
const providersArrayNodes = tsquery(ast, PROVIDERS_ARRAY_SELECTOR, {
|
|
448
|
+
visitAllChildren: true,
|
|
449
|
+
});
|
|
450
|
+
if (providersArrayNodes.length === 0) {
|
|
451
|
+
throw new Error(`Providers does not exist in the bootstrapApplication call within ${filePath}.`);
|
|
452
|
+
}
|
|
453
|
+
const arrayNode = providersArrayNodes[0];
|
|
454
|
+
const newFileContents = `${fileContents.slice(0, arrayNode.getStart() + 1)}${providerToAdd},${fileContents.slice(arrayNode.getStart() + 1, fileContents.length)}`;
|
|
455
|
+
tree.write(filePath, newFileContents);
|
|
456
|
+
}
|
|
457
|
+
exports.addProviderToBootstrapApplication = addProviderToBootstrapApplication;
|
|
458
|
+
/**
|
|
459
|
+
* Add a provider to appConfig for Standalone Applications
|
|
460
|
+
* NOTE: The appConfig must be marked with type ApplicationConfig and the providers must be declared as an array in the config
|
|
461
|
+
* @param tree Virtual Tree
|
|
462
|
+
* @param filePath Path to the file containing the bootstrapApplication call
|
|
463
|
+
* @param providerToAdd Provider to add
|
|
464
|
+
*/
|
|
465
|
+
function addProviderToAppConfig(tree, filePath, providerToAdd) {
|
|
466
|
+
(0, ensure_typescript_1.ensureTypescript)();
|
|
467
|
+
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
468
|
+
const PROVIDERS_ARRAY_SELECTOR = 'VariableDeclaration:has(TypeReference > Identifier[name=ApplicationConfig]) > ObjectLiteralExpression PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression';
|
|
469
|
+
const fileContents = tree.read(filePath, 'utf-8');
|
|
470
|
+
const ast = tsquery.ast(fileContents);
|
|
471
|
+
const providersArrayNodes = tsquery(ast, PROVIDERS_ARRAY_SELECTOR, {
|
|
472
|
+
visitAllChildren: true,
|
|
473
|
+
});
|
|
474
|
+
if (providersArrayNodes.length === 0) {
|
|
475
|
+
throw new Error(`'providers' does not exist in the application configuration at '${filePath}'.`);
|
|
476
|
+
}
|
|
477
|
+
const arrayNode = providersArrayNodes[0];
|
|
478
|
+
const newFileContents = `${fileContents.slice(0, arrayNode.getStart() + 1)}${providerToAdd},${fileContents.slice(arrayNode.getStart() + 1, fileContents.length)}`;
|
|
479
|
+
tree.write(filePath, newFileContents);
|
|
480
|
+
}
|
|
481
|
+
exports.addProviderToAppConfig = addProviderToAppConfig;
|
|
482
|
+
/**
|
|
483
|
+
* Add a provider to an NgModule
|
|
484
|
+
* @param host Virtual Tree
|
|
485
|
+
* @param source TS Source File containing the NgModule
|
|
486
|
+
* @param modulePath Path to the NgModule
|
|
487
|
+
* @param symbolName The provider to add
|
|
488
|
+
*/
|
|
489
|
+
function addProviderToModule(host, source, modulePath, symbolName) {
|
|
490
|
+
return _addSymbolToNgModuleMetadata(host, source, modulePath, 'providers', symbolName);
|
|
491
|
+
}
|
|
492
|
+
exports.addProviderToModule = addProviderToModule;
|
|
493
|
+
/**
|
|
494
|
+
* Add a provider to a Standalone Component
|
|
495
|
+
* @param host Virtual Tree
|
|
496
|
+
* @param source TS Source File containing the Component
|
|
497
|
+
* @param componentPath Path to the Component
|
|
498
|
+
* @param symbolName The provider to add
|
|
499
|
+
*/
|
|
500
|
+
function addProviderToComponent(host, source, componentPath, symbolName) {
|
|
501
|
+
return _addSymbolToDecoratorMetadata(host, source, componentPath, 'providers', symbolName, 'Component');
|
|
502
|
+
}
|
|
503
|
+
exports.addProviderToComponent = addProviderToComponent;
|
|
504
|
+
function addDeclarationToModule(host, source, modulePath, symbolName) {
|
|
505
|
+
return _addSymbolToNgModuleMetadata(host, source, modulePath, 'declarations', symbolName);
|
|
506
|
+
}
|
|
507
|
+
exports.addDeclarationToModule = addDeclarationToModule;
|
|
508
|
+
function addEntryComponents(host, source, modulePath, symbolName) {
|
|
509
|
+
return _addSymbolToNgModuleMetadata(host, source, modulePath, 'entryComponents', symbolName);
|
|
510
|
+
}
|
|
511
|
+
exports.addEntryComponents = addEntryComponents;
|
|
512
|
+
function readBootstrapInfo(host, app) {
|
|
513
|
+
if (!tsModule) {
|
|
514
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
515
|
+
}
|
|
516
|
+
const config = (0, devkit_1.readProjectConfiguration)(host, app);
|
|
517
|
+
let mainPath;
|
|
518
|
+
try {
|
|
519
|
+
mainPath =
|
|
520
|
+
config.targets.build.options.main ?? config.targets.build.options.browser;
|
|
521
|
+
}
|
|
522
|
+
catch (e) {
|
|
523
|
+
throw new Error('Main file cannot be located');
|
|
524
|
+
}
|
|
525
|
+
if (!host.exists(mainPath)) {
|
|
526
|
+
throw new Error('Main file cannot be located');
|
|
527
|
+
}
|
|
528
|
+
const mainSource = host.read(mainPath).toString('utf-8');
|
|
529
|
+
const main = tsModule.createSourceFile(mainPath, mainSource, tsModule.ScriptTarget.Latest, true);
|
|
530
|
+
const moduleImports = (0, js_1.getImport)(main, (s) => s.indexOf('.module') > -1);
|
|
531
|
+
if (moduleImports.length !== 1) {
|
|
532
|
+
throw new Error(`main.ts can only import a single module`);
|
|
533
|
+
}
|
|
534
|
+
const moduleImport = moduleImports[0];
|
|
535
|
+
const moduleClassName = moduleImport.bindings.filter((b) => b.endsWith('Module'))[0];
|
|
536
|
+
const modulePath = `${(0, path_1.join)((0, path_1.dirname)(mainPath), moduleImport.moduleSpec)}.ts`;
|
|
537
|
+
if (!host.exists(modulePath)) {
|
|
538
|
+
throw new Error(`Cannot find '${modulePath}'`);
|
|
539
|
+
}
|
|
540
|
+
const moduleSourceText = host.read(modulePath).toString('utf-8');
|
|
541
|
+
const moduleSource = tsModule.createSourceFile(modulePath, moduleSourceText, tsModule.ScriptTarget.Latest, true);
|
|
542
|
+
const bootstrapComponentClassName = getBootstrapComponent(moduleSource, moduleClassName);
|
|
543
|
+
const bootstrapComponentFileName = `./${(0, path_1.join)((0, path_1.dirname)(moduleImport.moduleSpec), `${(0, devkit_1.names)(bootstrapComponentClassName.substring(0, bootstrapComponentClassName.length - 9)).fileName}.component`)}`;
|
|
544
|
+
return {
|
|
545
|
+
moduleSpec: moduleImport.moduleSpec,
|
|
546
|
+
mainPath,
|
|
547
|
+
modulePath,
|
|
548
|
+
moduleSource,
|
|
549
|
+
moduleClassName,
|
|
550
|
+
bootstrapComponentClassName,
|
|
551
|
+
bootstrapComponentFileName,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
exports.readBootstrapInfo = readBootstrapInfo;
|
|
555
|
+
function getDecoratorPropertyValueNode(host, modulePath, identifier, property, module) {
|
|
556
|
+
if (!tsModule) {
|
|
557
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
558
|
+
}
|
|
559
|
+
const moduleSourceText = host.read(modulePath).toString('utf-8');
|
|
560
|
+
const moduleSource = tsModule.createSourceFile(modulePath, moduleSourceText, tsModule.ScriptTarget.Latest, true);
|
|
561
|
+
const templateNode = getMatchingProperty(moduleSource, property, identifier, module);
|
|
562
|
+
return templateNode.getChildAt(templateNode.getChildCount() - 1);
|
|
563
|
+
}
|
|
564
|
+
exports.getDecoratorPropertyValueNode = getDecoratorPropertyValueNode;
|
|
565
|
+
function getMatchingObjectLiteralElement(node, source, property) {
|
|
566
|
+
if (!tsModule) {
|
|
567
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
568
|
+
}
|
|
569
|
+
return (node.properties
|
|
570
|
+
.filter((prop) => prop.kind == tsModule.SyntaxKind.PropertyAssignment)
|
|
571
|
+
// Filter out every fields that's not "metadataField". Also handles string literals
|
|
572
|
+
// (but not expressions).
|
|
573
|
+
.filter((prop) => {
|
|
574
|
+
const name = prop.name;
|
|
575
|
+
switch (name.kind) {
|
|
576
|
+
case tsModule.SyntaxKind.Identifier:
|
|
577
|
+
return name.getText(source) === property;
|
|
578
|
+
case tsModule.SyntaxKind.StringLiteral:
|
|
579
|
+
return name.text === property;
|
|
580
|
+
}
|
|
581
|
+
return false;
|
|
582
|
+
})[0]);
|
|
583
|
+
}
|
|
584
|
+
function getTsSourceFile(host, path) {
|
|
585
|
+
if (!tsModule) {
|
|
586
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
587
|
+
}
|
|
588
|
+
const buffer = host.read(path);
|
|
589
|
+
if (!buffer) {
|
|
590
|
+
throw new Error(`Could not read TS file (${path}).`);
|
|
591
|
+
}
|
|
592
|
+
const content = buffer.toString();
|
|
593
|
+
const source = tsModule.createSourceFile(path, content, tsModule.ScriptTarget.Latest, true);
|
|
594
|
+
return source;
|
|
595
|
+
}
|
|
596
|
+
exports.getTsSourceFile = getTsSourceFile;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Add a new route to a routes definition
|
|
4
|
+
* @param tree Virtual Tree
|
|
5
|
+
* @param routesFile File containing the routes definition
|
|
6
|
+
* @param route Route to add
|
|
7
|
+
* @param lazy If Route should be lazy-loaded
|
|
8
|
+
* @param routesConst Used when eager-loading a route: Class name of the Component
|
|
9
|
+
* @param importPath Used when eager-loading a route: The import path to the Component
|
|
10
|
+
*/
|
|
11
|
+
export declare function addRoute(tree: Tree, routesFile: string, route: string, lazy?: boolean, routesConst?: string, importPath?: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Add a provider to a standalone routes definition
|
|
14
|
+
* @param tree Virtual Tree
|
|
15
|
+
* @param routesFile The file containing the routes definition
|
|
16
|
+
* @param routeToAddProviderTo The route to add the provider to
|
|
17
|
+
* @param providerToAdd The provider to add to the route
|
|
18
|
+
*/
|
|
19
|
+
export declare function addProviderToRoute(tree: Tree, routesFile: string, routeToAddProviderTo: string, providerToAdd: string): void;
|