@nx/angular 16.8.0-beta.3 → 16.8.0-beta.5

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.
Files changed (220) hide show
  1. package/mf/mf.js +31 -36
  2. package/migrations.json +9 -0
  3. package/package.json +11 -11
  4. package/plugins/component-testing.js +82 -44
  5. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +4 -6
  6. package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +4 -6
  7. package/src/builders/utilities/buildable-libs.js +1 -2
  8. package/src/builders/utilities/module-federation.js +2 -3
  9. package/src/builders/utilities/webpack.js +16 -21
  10. package/src/builders/webpack-browser/webpack-browser.impl.js +13 -13
  11. package/src/builders/webpack-dev-server/lib/normalize-options.js +8 -1
  12. package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +24 -18
  13. package/src/builders/webpack-server/webpack-server.impl.js +5 -7
  14. package/src/executors/browser-esbuild/browser-esbuild.impl.js +19 -23
  15. package/src/executors/browser-esbuild/lib/buildable-libs.js +1 -2
  16. package/src/executors/delegate-build/delegate-build.impl.js +9 -12
  17. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +4 -7
  18. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.js +4 -5
  19. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js +158 -156
  20. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/options.di.js +6 -3
  21. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js +118 -118
  22. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/styles/stylesheet-processor.js +96 -103
  23. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.js +20 -12
  24. package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +18 -21
  25. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +6 -9
  26. package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +6 -3
  27. package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +122 -122
  28. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +96 -103
  29. package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.js +21 -13
  30. package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +5 -8
  31. package/src/executors/package/package.impl.js +33 -38
  32. package/src/executors/utilities/angular-version-utils.js +1 -1
  33. package/src/executors/utilities/tailwindcss.js +2 -2
  34. package/src/executors/utilities/typescript.js +23 -28
  35. package/src/generators/add-linting/add-linting.js +76 -69
  36. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +2 -0
  37. package/src/generators/add-linting/lib/create-eslint-configuration.js +12 -4
  38. package/src/generators/application/application.js +56 -55
  39. package/src/generators/application/lib/add-e2e.js +36 -40
  40. package/src/generators/application/lib/add-linting.js +12 -15
  41. package/src/generators/application/lib/add-proxy-config.js +4 -1
  42. package/src/generators/application/lib/add-unit-test-runner.js +15 -18
  43. package/src/generators/application/lib/create-files.js +44 -47
  44. package/src/generators/application/lib/enable-strict-type-checking.js +2 -2
  45. package/src/generators/application/lib/normalize-options.js +37 -25
  46. package/src/generators/application/lib/set-app-strict-default.js +1 -2
  47. package/src/generators/application/lib/update-editor-tsconfig.js +1 -2
  48. package/src/generators/component/component.js +40 -43
  49. package/src/generators/component/lib/normalize-options.js +15 -5
  50. package/src/generators/component-cypress-spec/component-cypress-spec.js +25 -28
  51. package/src/generators/component-story/component-story.js +19 -22
  52. package/src/generators/convert-to-with-mf/convert-to-with-mf.js +19 -22
  53. package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +3 -4
  54. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +103 -106
  55. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +59 -62
  56. package/src/generators/directive/directive.js +21 -24
  57. package/src/generators/directive/lib/normalize-options.js +11 -5
  58. package/src/generators/host/files/src/main.server.ts__tmpl__ +1 -1
  59. package/src/generators/host/host.js +77 -67
  60. package/src/generators/host/lib/add-ssr.js +32 -33
  61. package/src/generators/init/init.js +101 -92
  62. package/src/generators/library/lib/add-standalone-component.js +18 -13
  63. package/src/generators/library/lib/enable-strict-type-checking.js +17 -5
  64. package/src/generators/library/lib/normalize-options.js +68 -53
  65. package/src/generators/library/library.js +89 -92
  66. package/src/generators/library-secondary-entry-point/lib/add-files.js +5 -1
  67. package/src/generators/library-secondary-entry-point/lib/normalize-options.js +6 -3
  68. package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +1 -2
  69. package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +6 -9
  70. package/src/generators/move/lib/normalize-schema.js +5 -1
  71. package/src/generators/move/lib/update-module-name.js +1 -1
  72. package/src/generators/move/lib/update-ng-package.js +1 -2
  73. package/src/generators/move/lib/update-secondary-entry-points.js +1 -2
  74. package/src/generators/move/move.js +9 -12
  75. package/src/generators/ng-add/migrate-from-angular-cli.js +54 -53
  76. package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +4 -3
  77. package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.js +11 -12
  78. package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +39 -42
  79. package/src/generators/ng-add/migrators/builders/builder.migrator.js +1 -2
  80. package/src/generators/ng-add/migrators/migrator.js +7 -11
  81. package/src/generators/ng-add/migrators/projects/app.migrator.js +39 -43
  82. package/src/generators/ng-add/migrators/projects/e2e.migrator.js +115 -91
  83. package/src/generators/ng-add/migrators/projects/lib.migrator.js +23 -31
  84. package/src/generators/ng-add/migrators/projects/project.migrator.js +10 -14
  85. package/src/generators/ng-add/ng-add.js +5 -8
  86. package/src/generators/ng-add/utilities/dependencies.js +2 -3
  87. package/src/generators/ng-add/utilities/format-files-task.js +1 -1
  88. package/src/generators/ng-add/utilities/projects.js +1 -1
  89. package/src/generators/ng-add/utilities/workspace.js +25 -36
  90. package/src/generators/ngrx/lib/add-imports-to-module.js +1 -2
  91. package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +1 -3
  92. package/src/generators/ngrx/lib/generate-files.js +11 -2
  93. package/src/generators/ngrx/lib/normalize-options.js +9 -4
  94. package/src/generators/ngrx/lib/validate-options.js +3 -3
  95. package/src/generators/ngrx/ngrx.js +18 -21
  96. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.actions.ts__tmpl__ +1 -1
  97. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.effects.spec.ts__tmpl__ +2 -2
  98. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.effects.ts__tmpl__ +2 -2
  99. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ +6 -6
  100. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.facade.ts__tmpl__ +3 -3
  101. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.reducer.spec.ts__tmpl__ +3 -3
  102. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.reducer.ts__tmpl__ +2 -2
  103. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.selectors.spec.ts__tmpl__ +3 -3
  104. package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.selectors.ts__tmpl__ +1 -1
  105. package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +2 -2
  106. package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +3 -3
  107. package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +4 -1
  108. package/src/generators/ngrx-feature-store/lib/add-imports.js +1 -1
  109. package/src/generators/ngrx-feature-store/lib/add-ngrx-to-package-json.js +1 -3
  110. package/src/generators/ngrx-feature-store/lib/generate-files.js +20 -4
  111. package/src/generators/ngrx-feature-store/lib/normalize-options.d.ts +1 -0
  112. package/src/generators/ngrx-feature-store/lib/normalize-options.js +22 -3
  113. package/src/generators/ngrx-feature-store/lib/validate-options.js +2 -2
  114. package/src/generators/ngrx-feature-store/ngrx-feature-store.js +18 -21
  115. package/src/generators/ngrx-root-store/lib/add-ngrx-to-package-json.js +8 -6
  116. package/src/generators/ngrx-root-store/lib/normalize-options.js +8 -4
  117. package/src/generators/ngrx-root-store/lib/validate-options.js +2 -2
  118. package/src/generators/ngrx-root-store/ngrx-root-store.js +27 -30
  119. package/src/generators/pipe/lib/normalize-options.js +9 -3
  120. package/src/generators/pipe/pipe.js +21 -24
  121. package/src/generators/remote/files/base/src/main.server.ts__tmpl__ +2 -2
  122. package/src/generators/remote/lib/add-ssr.js +46 -43
  123. package/src/generators/remote/lib/find-next-available-port.js +1 -2
  124. package/src/generators/remote/remote.js +52 -49
  125. package/src/generators/scam/lib/convert-component-to-scam.js +1 -2
  126. package/src/generators/scam/lib/normalize-options.js +11 -4
  127. package/src/generators/scam/scam.js +15 -12
  128. package/src/generators/scam-directive/lib/normalize-options.js +12 -4
  129. package/src/generators/scam-directive/scam-directive.js +13 -10
  130. package/src/generators/scam-pipe/lib/normalize-options.js +12 -4
  131. package/src/generators/scam-pipe/scam-pipe.js +13 -10
  132. package/src/generators/scam-to-standalone/scam-to-standalone.js +23 -26
  133. package/src/generators/setup-mf/lib/add-cypress-workaround.js +1 -1
  134. package/src/generators/setup-mf/lib/add-remote-to-host.js +4 -1
  135. package/src/generators/setup-mf/lib/change-build-target.js +10 -4
  136. package/src/generators/setup-mf/lib/generate-config.js +1 -1
  137. package/src/generators/setup-mf/lib/get-remotes-with-ports.js +1 -2
  138. package/src/generators/setup-mf/lib/normalize-options.js +5 -2
  139. package/src/generators/setup-mf/lib/set-tsconfig-target.js +7 -1
  140. package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +1 -2
  141. package/src/generators/setup-mf/lib/setup-serve-target.js +10 -3
  142. package/src/generators/setup-mf/setup-mf.js +32 -35
  143. package/src/generators/setup-ssr/lib/generate-files.js +8 -5
  144. package/src/generators/setup-ssr/lib/normalize-options.js +9 -10
  145. package/src/generators/setup-ssr/lib/update-project-config.js +21 -17
  146. package/src/generators/setup-ssr/setup-ssr.js +26 -27
  147. package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.js +6 -4
  148. package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.js +1 -2
  149. package/src/generators/setup-tailwind/lib/normalize-options.js +4 -1
  150. package/src/generators/setup-tailwind/lib/update-application-styles.js +5 -6
  151. package/src/generators/setup-tailwind/setup-tailwind.js +20 -23
  152. package/src/generators/stories/lib/get-e2e-project.js +1 -1
  153. package/src/generators/stories/stories.js +43 -50
  154. package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.js +1 -1
  155. package/src/generators/storybook-configuration/lib/generate-stories.js +10 -13
  156. package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +12 -15
  157. package/src/generators/storybook-configuration/storybook-configuration.js +20 -16
  158. package/src/generators/utils/create-ts-config.js +1 -1
  159. package/src/generators/utils/entry-point.js +1 -2
  160. package/src/generators/utils/export-scam.js +1 -1
  161. package/src/generators/utils/insert-ngmodule-import.js +1 -1
  162. package/src/generators/utils/path.js +3 -3
  163. package/src/generators/utils/project.js +2 -3
  164. package/src/generators/utils/selector.js +1 -1
  165. package/src/generators/utils/storybook-ast/component-info.js +1 -2
  166. package/src/generators/utils/storybook-ast/entry-point.js +1 -2
  167. package/src/generators/utils/storybook-ast/module-info.js +1 -2
  168. package/src/generators/utils/storybook-ast/tree-utilities.js +1 -1
  169. package/src/generators/utils/testing.js +141 -138
  170. package/src/generators/utils/validations.js +1 -1
  171. package/src/generators/utils/version-utils.js +5 -7
  172. package/src/generators/web-worker/lib/normalize-options.js +6 -3
  173. package/src/generators/web-worker/web-worker.js +25 -28
  174. package/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.js +10 -13
  175. package/src/migrations/update-14-2-0/update-angular-cli.js +14 -18
  176. package/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.js +22 -26
  177. package/src/migrations/update-14-2-0/update-ngcc-target.js +10 -14
  178. package/src/migrations/update-14-2-0/update-router-initial-navigation.js +31 -39
  179. package/src/migrations/update-14-2-0/update-tsconfig-target.js +48 -56
  180. package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js +14 -17
  181. package/src/migrations/update-14-5-2/update-angular-cli.js +14 -18
  182. package/src/migrations/update-14-6-0/update-angular-cli.js +14 -18
  183. package/src/migrations/update-15-0-0/add-karma-inputs.js +27 -32
  184. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +62 -68
  185. package/src/migrations/update-15-2-0/remove-browserlist-config.js +34 -37
  186. package/src/migrations/update-15-2-0/remove-platform-server-exports.js +49 -52
  187. package/src/migrations/update-15-2-0/update-angular-cli.js +14 -18
  188. package/src/migrations/update-15-2-0/update-karma-main-file.js +11 -12
  189. package/src/migrations/update-15-2-0/update-typescript-target.js +40 -39
  190. package/src/migrations/update-15-2-0/update-workspace-config.js +16 -19
  191. package/src/migrations/update-15-5-0/update-angular-cli.js +14 -18
  192. package/src/migrations/update-15-7-0/install-required-packages.js +26 -28
  193. package/src/migrations/update-15-8-0/update-angular-cli.js +14 -18
  194. package/src/migrations/update-15-9-0/update-file-server-executor.js +31 -35
  195. package/src/migrations/update-15-9-0/update-testing-tsconfig.js +17 -22
  196. package/src/migrations/update-16-0-0/remove-karma-defaults.js +15 -18
  197. package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +22 -25
  198. package/src/migrations/update-16-0-0/remove-protractor-defaults.js +15 -18
  199. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
  200. package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +38 -42
  201. package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +15 -19
  202. package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +49 -52
  203. package/src/migrations/update-16-1-0/update-angular-cli.js +14 -18
  204. package/src/migrations/update-16-1-0/update-server-executor-config.js +13 -16
  205. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +25 -29
  206. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +13 -16
  207. package/src/migrations/update-16-4-0/update-angular-cli.js +14 -18
  208. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +19 -24
  209. package/src/migrations/update-16-7-0/update-angular-cli.js +14 -18
  210. package/src/migrations/utils/projects.js +9 -15
  211. package/src/utils/backward-compatible-versions.js +2 -0
  212. package/src/utils/get-mf-projects.js +1 -2
  213. package/src/utils/mf/utils.js +43 -44
  214. package/src/utils/mf/with-module-federation-ssr.js +39 -24
  215. package/src/utils/mf/with-module-federation.js +40 -21
  216. package/src/utils/nx-devkit/ast-utils.js +2 -3
  217. package/src/utils/nx-devkit/testing.js +9 -9
  218. package/src/utils/version-utils.js +2 -4
  219. package/src/utils/versions.d.ts +1 -0
  220. package/src/utils/versions.js +2 -1
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGeneratorInternal = exports.libraryGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const jest_1 = require("@nx/jest");
7
6
  const linter_1 = require("@nx/linter");
@@ -21,87 +20,88 @@ const update_lib_package_npm_scope_1 = require("./lib/update-lib-package-npm-sco
21
20
  const update_tsconfig_1 = require("./lib/update-tsconfig");
22
21
  const create_files_1 = require("./lib/create-files");
23
22
  const add_project_1 = require("./lib/add-project");
24
- function libraryGenerator(tree, schema) {
25
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
- return yield libraryGeneratorInternal(tree, Object.assign({
27
- // provide a default projectNameAndRootFormat to avoid breaking changes
28
- // to external generators invoking this one
29
- projectNameAndRootFormat: 'derived' }, schema));
23
+ async function libraryGenerator(tree, schema) {
24
+ return await libraryGeneratorInternal(tree, {
25
+ // provide a default projectNameAndRootFormat to avoid breaking changes
26
+ // to external generators invoking this one
27
+ projectNameAndRootFormat: 'derived',
28
+ ...schema,
30
29
  });
31
30
  }
32
31
  exports.libraryGenerator = libraryGenerator;
33
- function libraryGeneratorInternal(tree, schema) {
34
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- // Do some validation checks
36
- if (!schema.routing && schema.lazy) {
37
- throw new Error(`To use "--lazy" option, "--routing" must also be set.`);
38
- }
39
- if (schema.publishable === true && !schema.importPath) {
40
- throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
41
- }
42
- if (schema.addTailwind && !schema.buildable && !schema.publishable) {
43
- throw new Error(`To use "--addTailwind" option, you have to set either "--buildable" or "--publishable".`);
44
- }
45
- const userInstalledAngularVersion = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
46
- if ((0, semver_1.lt)(userInstalledAngularVersion.version, '14.1.0') && schema.standalone) {
47
- throw new Error(`The "--standalone" option is not supported in Angular versions < 14.1.0.`);
48
- }
49
- const options = yield (0, normalize_options_1.normalizeOptions)(tree, schema);
50
- const { libraryOptions } = options;
51
- const pkgVersions = (0, version_utils_1.versions)(tree);
52
- yield (0, init_1.default)(tree, Object.assign(Object.assign({}, libraryOptions), { skipFormat: true, e2eTestRunner: test_runners_1.E2eTestRunner.None }));
53
- const project = (0, add_project_1.addProject)(tree, libraryOptions);
54
- (0, create_files_1.createFiles)(tree, options, project);
55
- (0, update_tsconfig_1.updateTsConfig)(tree, libraryOptions);
56
- yield addUnitTestRunner(tree, libraryOptions);
57
- updateNpmScopeIfBuildableOrPublishable(tree, libraryOptions);
58
- if (!libraryOptions.standalone) {
59
- (0, add_module_1.addModule)(tree, libraryOptions);
60
- }
61
- else {
62
- yield (0, add_standalone_component_1.addStandaloneComponent)(tree, options);
63
- }
64
- setStrictMode(tree, libraryOptions);
65
- yield addLinting(tree, libraryOptions);
66
- if (libraryOptions.addTailwind) {
67
- yield (0, setup_tailwind_1.default)(tree, {
68
- project: libraryOptions.name,
69
- skipFormat: true,
70
- });
71
- }
72
- if (libraryOptions.buildable || libraryOptions.publishable) {
73
- (0, version_utils_1.addDependenciesToPackageJsonIfDontExist)(tree, {}, {
74
- 'ng-packagr': pkgVersions.ngPackagrVersion,
75
- });
76
- (0, dependencies_1.addBuildableLibrariesPostCssDependencies)(tree);
77
- }
78
- (0, js_1.addTsConfigPath)(tree, libraryOptions.importPath, [
79
- (0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, './src', 'index.ts'),
80
- ]);
81
- if (!libraryOptions.skipFormat) {
82
- yield (0, devkit_1.formatFiles)(tree);
83
- }
84
- return () => {
85
- (0, devkit_1.installPackagesTask)(tree);
86
- };
32
+ async function libraryGeneratorInternal(tree, schema) {
33
+ // Do some validation checks
34
+ if (!schema.routing && schema.lazy) {
35
+ throw new Error(`To use "--lazy" option, "--routing" must also be set.`);
36
+ }
37
+ if (schema.publishable === true && !schema.importPath) {
38
+ throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
39
+ }
40
+ if (schema.addTailwind && !schema.buildable && !schema.publishable) {
41
+ throw new Error(`To use "--addTailwind" option, you have to set either "--buildable" or "--publishable".`);
42
+ }
43
+ const userInstalledAngularVersion = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
44
+ if ((0, semver_1.lt)(userInstalledAngularVersion.version, '14.1.0') && schema.standalone) {
45
+ throw new Error(`The "--standalone" option is not supported in Angular versions < 14.1.0.`);
46
+ }
47
+ const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
48
+ const { libraryOptions } = options;
49
+ const pkgVersions = (0, version_utils_1.versions)(tree);
50
+ await (0, init_1.default)(tree, {
51
+ ...libraryOptions,
52
+ skipFormat: true,
53
+ e2eTestRunner: test_runners_1.E2eTestRunner.None,
87
54
  });
55
+ const project = (0, add_project_1.addProject)(tree, libraryOptions);
56
+ (0, create_files_1.createFiles)(tree, options, project);
57
+ (0, update_tsconfig_1.updateTsConfig)(tree, libraryOptions);
58
+ await addUnitTestRunner(tree, libraryOptions);
59
+ updateNpmScopeIfBuildableOrPublishable(tree, libraryOptions);
60
+ if (!libraryOptions.standalone) {
61
+ (0, add_module_1.addModule)(tree, libraryOptions);
62
+ }
63
+ else {
64
+ await (0, add_standalone_component_1.addStandaloneComponent)(tree, options);
65
+ }
66
+ setStrictMode(tree, libraryOptions);
67
+ await addLinting(tree, libraryOptions);
68
+ if (libraryOptions.addTailwind) {
69
+ await (0, setup_tailwind_1.default)(tree, {
70
+ project: libraryOptions.name,
71
+ skipFormat: true,
72
+ });
73
+ }
74
+ if (libraryOptions.buildable || libraryOptions.publishable) {
75
+ (0, version_utils_1.addDependenciesToPackageJsonIfDontExist)(tree, {}, {
76
+ 'ng-packagr': pkgVersions.ngPackagrVersion,
77
+ });
78
+ (0, dependencies_1.addBuildableLibrariesPostCssDependencies)(tree);
79
+ }
80
+ (0, js_1.addTsConfigPath)(tree, libraryOptions.importPath, [
81
+ (0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, './src', 'index.ts'),
82
+ ]);
83
+ if (!libraryOptions.skipFormat) {
84
+ await (0, devkit_1.formatFiles)(tree);
85
+ }
86
+ return () => {
87
+ (0, devkit_1.installPackagesTask)(tree);
88
+ };
88
89
  }
89
90
  exports.libraryGeneratorInternal = libraryGeneratorInternal;
90
- function addUnitTestRunner(host, options) {
91
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
92
- if (options.unitTestRunner === 'jest') {
93
- yield (0, jest_1.configurationGenerator)(host, {
94
- project: options.name,
95
- setupFile: 'angular',
96
- supportTsx: false,
97
- skipSerializers: false,
98
- skipFormat: true,
99
- skipPackageJson: options.skipPackageJson,
100
- });
101
- const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', 'test-setup.ts');
102
- if (options.strict && host.exists(setupFile)) {
103
- const contents = host.read(setupFile, 'utf-8');
104
- host.write(setupFile, `// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
91
+ async function addUnitTestRunner(host, options) {
92
+ if (options.unitTestRunner === 'jest') {
93
+ await (0, jest_1.configurationGenerator)(host, {
94
+ project: options.name,
95
+ setupFile: 'angular',
96
+ supportTsx: false,
97
+ skipSerializers: false,
98
+ skipFormat: true,
99
+ skipPackageJson: options.skipPackageJson,
100
+ });
101
+ const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', 'test-setup.ts');
102
+ if (options.strict && host.exists(setupFile)) {
103
+ const contents = host.read(setupFile, 'utf-8');
104
+ host.write(setupFile, `// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
105
105
  globalThis.ngJest = {
106
106
  testEnvironmentOptions: {
107
107
  errorOnUnknownElements: true,
@@ -109,9 +109,8 @@ globalThis.ngJest = {
109
109
  },
110
110
  };
111
111
  ${contents}`);
112
- }
113
112
  }
114
- });
113
+ }
115
114
  }
116
115
  function updateNpmScopeIfBuildableOrPublishable(host, options) {
117
116
  if (options.buildable || options.publishable) {
@@ -126,20 +125,18 @@ function setStrictMode(host, options) {
126
125
  (0, enable_strict_type_checking_1.setLibraryStrictDefault)(host, options.strict);
127
126
  }
128
127
  }
129
- function addLinting(host, options) {
130
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
131
- if (options.linter === linter_1.Linter.None) {
132
- return;
133
- }
134
- yield (0, add_linting_1.default)(host, {
135
- projectName: options.name,
136
- projectRoot: options.projectRoot,
137
- prefix: options.prefix,
138
- unitTestRunner: options.unitTestRunner,
139
- setParserOptionsProject: options.setParserOptionsProject,
140
- skipFormat: true,
141
- skipPackageJson: options.skipPackageJson,
142
- });
128
+ async function addLinting(host, options) {
129
+ if (options.linter === linter_1.Linter.None) {
130
+ return;
131
+ }
132
+ await (0, add_linting_1.default)(host, {
133
+ projectName: options.name,
134
+ projectRoot: options.projectRoot,
135
+ prefix: options.prefix,
136
+ unitTestRunner: options.unitTestRunner,
137
+ setParserOptionsProject: options.setParserOptionsProject,
138
+ skipFormat: true,
139
+ skipPackageJson: options.skipPackageJson,
143
140
  });
144
141
  }
145
142
  exports.default = libraryGenerator;
@@ -4,7 +4,11 @@ exports.addFiles = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  function addFiles(tree, options) {
6
6
  const nameVariants = (0, devkit_1.names)(options.name);
7
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.entryPointDestination, Object.assign(Object.assign(Object.assign({}, options), nameVariants), { tmpl: '' }));
7
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), options.entryPointDestination, {
8
+ ...options,
9
+ ...nameVariants,
10
+ tmpl: '',
11
+ });
8
12
  if (options.skipModule) {
9
13
  tree.delete((0, devkit_1.joinPathFragments)(options.entryPointDestination, `src/lib/${nameVariants.fileName}.module.ts`));
10
14
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  function normalizeOptions(tree, options) {
6
- var _a;
7
6
  const name = (0, devkit_1.names)(options.name).fileName;
8
7
  const projects = (0, devkit_1.getProjects)(tree);
9
8
  const libraryProject = projects.get(options.library);
@@ -19,10 +18,14 @@ function normalizeOptions(tree, options) {
19
18
  }
20
19
  const { name: mainEntryPoint } = (0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(libraryProject.root, 'package.json'));
21
20
  const secondaryEntryPoint = `${mainEntryPoint}/${options.name}`;
22
- return Object.assign(Object.assign({}, options), { entryPointDestination,
21
+ return {
22
+ ...options,
23
+ entryPointDestination,
23
24
  mainEntryPoint,
24
25
  name,
25
26
  libraryProject,
26
- secondaryEntryPoint, skipModule: (_a = options.skipModule) !== null && _a !== void 0 ? _a : false });
27
+ secondaryEntryPoint,
28
+ skipModule: options.skipModule ?? false,
29
+ };
27
30
  }
28
31
  exports.normalizeOptions = normalizeOptions;
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateLintingFilePatterns = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  function updateLintingFilePatterns(tree, options) {
6
- var _a, _b, _c;
7
6
  const { libraryProject } = options;
8
- if ((_c = (_b = (_a = libraryProject.targets) === null || _a === void 0 ? void 0 : _a.lint) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.lintFilePatterns) {
7
+ if (libraryProject.targets?.lint?.options?.lintFilePatterns) {
9
8
  libraryProject.targets.lint.options.lintFilePatterns.push(...[
10
9
  `${libraryProject.root}/${options.name}/**/*.ts`,
11
10
  `${libraryProject.root}/${options.name}/**/*.html`,
@@ -1,17 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.librarySecondaryEntryPointGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const lib_1 = require("./lib");
7
- function librarySecondaryEntryPointGenerator(tree, rawOptions) {
8
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
- const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
10
- (0, lib_1.addFiles)(tree, options);
11
- (0, lib_1.addPathMapping)(tree, options);
12
- (0, lib_1.updateLintingFilePatterns)(tree, options);
13
- yield (0, devkit_1.formatFiles)(tree);
14
- });
6
+ async function librarySecondaryEntryPointGenerator(tree, rawOptions) {
7
+ const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
8
+ (0, lib_1.addFiles)(tree, options);
9
+ (0, lib_1.addPathMapping)(tree, options);
10
+ (0, lib_1.updateLintingFilePatterns)(tree, options);
11
+ await (0, devkit_1.formatFiles)(tree);
15
12
  }
16
13
  exports.librarySecondaryEntryPointGenerator = librarySecondaryEntryPointGenerator;
17
14
  exports.default = librarySecondaryEntryPointGenerator;
@@ -6,6 +6,10 @@ const get_new_project_name_1 = require("../../utils/get-new-project-name");
6
6
  function normalizeSchema(tree, schema) {
7
7
  const newProjectName = (0, get_new_project_name_1.getNewProjectName)(schema.destination);
8
8
  const { root } = (0, devkit_1.readProjectConfiguration)(tree, schema.projectName);
9
- return Object.assign(Object.assign({}, schema), { newProjectName, oldProjectRoot: root });
9
+ return {
10
+ ...schema,
11
+ newProjectName,
12
+ oldProjectRoot: root,
13
+ };
10
14
  }
11
15
  exports.normalizeSchema = normalizeSchema;
@@ -87,7 +87,7 @@ function updateFileContent(tree, replacements, fileName, newFileName) {
87
87
  }
88
88
  });
89
89
  if (updated) {
90
- tree.write(newFileName !== null && newFileName !== void 0 ? newFileName : fileName, content);
90
+ tree.write(newFileName ?? fileName, content);
91
91
  }
92
92
  }
93
93
  }
@@ -4,7 +4,6 @@ exports.updateNgPackage = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  function updateNgPackage(tree, schema) {
7
- var _a;
8
7
  const project = (0, devkit_1.readProjectConfiguration)(tree, schema.newProjectName);
9
8
  if (project.projectType === 'application') {
10
9
  return;
@@ -28,7 +27,7 @@ function updateNgPackage(tree, schema) {
28
27
  targets: project.targets,
29
28
  },
30
29
  });
31
- const output = (_a = outputs[0]) !== null && _a !== void 0 ? _a : `dist/${project.root}`;
30
+ const output = outputs[0] ?? `dist/${project.root}`;
32
31
  (0, devkit_1.updateJson)(tree, ngPackagePath, (json) => {
33
32
  json.dest = `${rootOffset}/${output}`;
34
33
  return json;
@@ -12,12 +12,11 @@ const libraryExecutors = [
12
12
  '@nrwl/angular:package',
13
13
  ];
14
14
  function updateSecondaryEntryPoints(tree, schema) {
15
- var _a;
16
15
  const project = (0, devkit_1.readProjectConfiguration)(tree, schema.newProjectName);
17
16
  if (project.projectType !== 'library') {
18
17
  return;
19
18
  }
20
- if (!Object.values((_a = project.targets) !== null && _a !== void 0 ? _a : {}).some((target) => libraryExecutors.includes(target.executor))) {
19
+ if (!Object.values(project.targets ?? {}).some((target) => libraryExecutors.includes(target.executor))) {
21
20
  return;
22
21
  }
23
22
  (0, devkit_1.visitNotIgnoredFiles)(tree, project.root, (filePath) => {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.angularMoveGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const generators_1 = require("@nx/workspace/generators");
7
6
  const lib_1 = require("./lib");
@@ -12,16 +11,14 @@ const lib_1 = require("./lib");
12
11
  * to the workspace, so it can't use the same tricks as the `@nx/workspace` rules
13
12
  * to get the before and after names and paths.
14
13
  */
15
- function angularMoveGenerator(tree, schema) {
16
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
17
- const normalizedSchema = (0, lib_1.normalizeSchema)(tree, schema);
18
- yield (0, generators_1.moveGenerator)(tree, Object.assign(Object.assign({}, schema), { skipFormat: true }));
19
- (0, lib_1.updateModuleName)(tree, normalizedSchema);
20
- (0, lib_1.updateNgPackage)(tree, normalizedSchema);
21
- (0, lib_1.updateSecondaryEntryPoints)(tree, normalizedSchema);
22
- if (!normalizedSchema.skipFormat) {
23
- yield (0, devkit_1.formatFiles)(tree);
24
- }
25
- });
14
+ async function angularMoveGenerator(tree, schema) {
15
+ const normalizedSchema = (0, lib_1.normalizeSchema)(tree, schema);
16
+ await (0, generators_1.moveGenerator)(tree, { ...schema, skipFormat: true });
17
+ (0, lib_1.updateModuleName)(tree, normalizedSchema);
18
+ (0, lib_1.updateNgPackage)(tree, normalizedSchema);
19
+ (0, lib_1.updateSecondaryEntryPoints)(tree, normalizedSchema);
20
+ if (!normalizedSchema.skipFormat) {
21
+ await (0, devkit_1.formatFiles)(tree);
22
+ }
26
23
  }
27
24
  exports.angularMoveGenerator = angularMoveGenerator;
@@ -1,61 +1,62 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrateFromAngularCli = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const migrators_1 = require("./migrators");
7
6
  const utilities_1 = require("./utilities");
8
- function migrateFromAngularCli(tree, options) {
9
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- (0, utilities_1.validateWorkspace)(tree);
11
- const projects = (0, utilities_1.getAllProjects)(tree);
12
- const angularJson = (0, devkit_1.readJson)(tree, 'angular.json');
13
- (0, utilities_1.ensureAngularDevKitPeerDependenciesAreInstalled)(tree);
14
- const migrators = [
15
- ...projects.apps.map((app) => new migrators_1.AppMigrator(tree, options, app)),
16
- ...projects.libs.map((lib) => new migrators_1.LibMigrator(tree, options, lib)),
17
- ];
18
- const workspaceRootFileTypesInfo = (0, utilities_1.getWorkspaceRootFileTypesInfo)(tree, migrators);
19
- /**
20
- * Keep a copy of the root eslint config to restore it later. We need to
21
- * do this because the root config can also be the config for the app at
22
- * the root of the Angular CLI workspace and it will be moved as part of
23
- * the app migration.
24
- */
25
- let eslintConfig = workspaceRootFileTypesInfo.eslint && tree.exists('.eslintrc.json')
26
- ? (0, devkit_1.readJson)(tree, '.eslintrc.json')
27
- : undefined;
28
- // create and update root files and configurations
29
- (0, devkit_1.updateJson)(tree, 'angular.json', (json) => (Object.assign(Object.assign({}, json), { version: 2, $schema: undefined })));
30
- (0, utilities_1.createNxJson)(tree, options, angularJson.defaultProject);
31
- (0, utilities_1.updateWorkspaceConfigDefaults)(tree);
32
- (0, utilities_1.updateRootTsConfig)(tree);
33
- (0, utilities_1.updatePackageJson)(tree);
34
- yield (0, utilities_1.createWorkspaceFiles)(tree);
35
- // migrate all projects
36
- for (const migrator of migrators) {
37
- yield migrator.migrate();
38
- }
39
- /**
40
- * This needs to be done last because the Angular CLI workspace can have
41
- * these files in the root for the root application, so we wait until
42
- * those root config files are moved when the projects are migrated.
43
- */
44
- if (workspaceRootFileTypesInfo.karma) {
45
- (0, utilities_1.createRootKarmaConfig)(tree);
46
- }
47
- if (workspaceRootFileTypesInfo.eslint) {
48
- (0, utilities_1.updateRootEsLintConfig)(tree, eslintConfig, options.unitTestRunner);
49
- (0, utilities_1.cleanupEsLintPackages)(tree);
50
- }
51
- (0, utilities_1.deleteGitKeepFilesIfNotNeeded)(tree);
52
- (0, utilities_1.deleteAngularJson)(tree);
53
- if (!options.skipInstall) {
54
- return () => {
55
- (0, devkit_1.installPackagesTask)(tree);
56
- (0, utilities_1.formatFilesTask)(tree);
57
- };
58
- }
59
- });
7
+ async function migrateFromAngularCli(tree, options) {
8
+ (0, utilities_1.validateWorkspace)(tree);
9
+ const projects = (0, utilities_1.getAllProjects)(tree);
10
+ const angularJson = (0, devkit_1.readJson)(tree, 'angular.json');
11
+ (0, utilities_1.ensureAngularDevKitPeerDependenciesAreInstalled)(tree);
12
+ const migrators = [
13
+ ...projects.apps.map((app) => new migrators_1.AppMigrator(tree, options, app)),
14
+ ...projects.libs.map((lib) => new migrators_1.LibMigrator(tree, options, lib)),
15
+ ];
16
+ const workspaceRootFileTypesInfo = (0, utilities_1.getWorkspaceRootFileTypesInfo)(tree, migrators);
17
+ /**
18
+ * Keep a copy of the root eslint config to restore it later. We need to
19
+ * do this because the root config can also be the config for the app at
20
+ * the root of the Angular CLI workspace and it will be moved as part of
21
+ * the app migration.
22
+ */
23
+ let eslintConfig = workspaceRootFileTypesInfo.eslint && tree.exists('.eslintrc.json')
24
+ ? (0, devkit_1.readJson)(tree, '.eslintrc.json')
25
+ : undefined;
26
+ // create and update root files and configurations
27
+ (0, devkit_1.updateJson)(tree, 'angular.json', (json) => ({
28
+ ...json,
29
+ version: 2,
30
+ $schema: undefined,
31
+ }));
32
+ (0, utilities_1.createNxJson)(tree, options, angularJson.defaultProject);
33
+ (0, utilities_1.updateWorkspaceConfigDefaults)(tree);
34
+ (0, utilities_1.updateRootTsConfig)(tree);
35
+ (0, utilities_1.updatePackageJson)(tree);
36
+ await (0, utilities_1.createWorkspaceFiles)(tree);
37
+ // migrate all projects
38
+ for (const migrator of migrators) {
39
+ await migrator.migrate();
40
+ }
41
+ /**
42
+ * This needs to be done last because the Angular CLI workspace can have
43
+ * these files in the root for the root application, so we wait until
44
+ * those root config files are moved when the projects are migrated.
45
+ */
46
+ if (workspaceRootFileTypesInfo.karma) {
47
+ (0, utilities_1.createRootKarmaConfig)(tree);
48
+ }
49
+ if (workspaceRootFileTypesInfo.eslint) {
50
+ (0, utilities_1.updateRootEsLintConfig)(tree, eslintConfig, options.unitTestRunner);
51
+ (0, utilities_1.cleanupEsLintPackages)(tree);
52
+ }
53
+ (0, utilities_1.deleteGitKeepFilesIfNotNeeded)(tree);
54
+ (0, utilities_1.deleteAngularJson)(tree);
55
+ if (!options.skipInstall) {
56
+ return () => {
57
+ (0, devkit_1.installPackagesTask)(tree);
58
+ (0, utilities_1.formatFilesTask)(tree);
59
+ };
60
+ }
60
61
  }
61
62
  exports.migrateFromAngularCli = migrateFromAngularCli;
@@ -58,11 +58,12 @@ class AngularDevkitKarmaMigrator extends builder_migrator_1.BuilderMigrator {
58
58
  target.options.scripts =
59
59
  target.options.scripts &&
60
60
  target.options.scripts.map((script) => this.convertAsset(script));
61
- (0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, Object.assign({}, this.projectConfig));
61
+ (0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
62
+ ...this.projectConfig,
63
+ });
62
64
  }
63
65
  updateTsConfigFileUsedByTestTarget(targetName, target) {
64
- var _a;
65
- if (!((_a = target.options) === null || _a === void 0 ? void 0 : _a.tsConfig)) {
66
+ if (!target.options?.tsConfig) {
66
67
  this.logger.warn(`The "${targetName}" target does not have the "tsConfig" option configured. Skipping updating the tsConfig file.`);
67
68
  return;
68
69
  }
@@ -35,21 +35,21 @@ class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator
35
35
  return;
36
36
  }
37
37
  ['project', 'tsConfig'].forEach((option) => {
38
- var _a, _b;
39
- if ((_a = target.options) === null || _a === void 0 ? void 0 : _a[option]) {
38
+ if (target.options?.[option]) {
40
39
  target.options[option] = (0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(target.options[option]));
41
40
  }
42
- for (const configuration of Object.values((_b = target.configurations) !== null && _b !== void 0 ? _b : {})) {
41
+ for (const configuration of Object.values(target.configurations ?? {})) {
43
42
  configuration[option] =
44
43
  configuration[option] &&
45
44
  (0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(configuration[option]));
46
45
  }
47
46
  });
48
- (0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, Object.assign({}, this.projectConfig));
47
+ (0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
48
+ ...this.projectConfig,
49
+ });
49
50
  }
50
51
  updateNgPackageJson(targetName, target) {
51
- var _a;
52
- if (!((_a = target.options) === null || _a === void 0 ? void 0 : _a.project)) {
52
+ if (!target.options?.project) {
53
53
  this.logger.warn(`The "${targetName}" target does not have the "project" option configured. Skipping updating the ng-packagr project file ("ng-package.json").`);
54
54
  return;
55
55
  }
@@ -68,16 +68,16 @@ class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator
68
68
  });
69
69
  }
70
70
  updateTsConfigs(targetName, target) {
71
- var _a, _b, _c, _d, _e, _f, _g;
72
- const tsConfigPath = (_b = (_a = target.options) === null || _a === void 0 ? void 0 : _a.tsConfig) !== null && _b !== void 0 ? _b : (_d = (_c = target.configurations) === null || _c === void 0 ? void 0 : _c.development) === null || _d === void 0 ? void 0 : _d.tsConfig;
71
+ const tsConfigPath = target.options?.tsConfig ?? target.configurations?.development?.tsConfig;
73
72
  if (!tsConfigPath) {
74
73
  this.logger.warn(`The "${targetName}" target does not have the "tsConfig" option configured. Skipping updating the tsConfig file.`);
75
74
  return;
76
75
  }
77
76
  else if (!this.tree.exists(tsConfigPath)) {
78
- const originalTsConfigPath = ((_e = target.options) === null || _e === void 0 ? void 0 : _e.tsConfig)
77
+ const originalTsConfigPath = target.options?.tsConfig
79
78
  ? this.originalProjectConfig.targets[targetName].options.tsConfig
80
- : (_g = (_f = this.originalProjectConfig.targets[targetName].configurations) === null || _f === void 0 ? void 0 : _f.development) === null || _g === void 0 ? void 0 : _g.tsConfig;
79
+ : this.originalProjectConfig.targets[targetName].configurations
80
+ ?.development?.tsConfig;
81
81
  this.logger.warn(`The tsConfig file "${originalTsConfigPath}" specified in the "${targetName}" target could not be found. Skipping updating the tsConfig file.`);
82
82
  return;
83
83
  }
@@ -85,8 +85,7 @@ class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator
85
85
  const projectOffsetFromRoot = (0, devkit_1.offsetFromRoot)(this.projectConfig.root);
86
86
  this.updateTsConfigFile(tsConfigPath, rootTsConfigFile, projectOffsetFromRoot);
87
87
  (0, devkit_1.updateJson)(this.tree, tsConfigPath, (json) => {
88
- var _a, _b;
89
- if (!((_a = json.include) === null || _a === void 0 ? void 0 : _a.length) && !((_b = json.files) === null || _b === void 0 ? void 0 : _b.length)) {
88
+ if (!json.include?.length && !json.files?.length) {
90
89
  json.include = ['**/*.ts'];
91
90
  }
92
91
  return json;