@nx/angular 0.0.0-pr-30715-a5f5e3b → 0.0.0-pr-31313-387cdca

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 (240) hide show
  1. package/fesm2022/nx-angular-mf.mjs.map +1 -1
  2. package/fesm2022/nx-angular.mjs.map +1 -1
  3. package/index.d.ts +1 -2
  4. package/mf/index.d.ts +1 -71
  5. package/mf/mf.d.ts +69 -0
  6. package/migrations.json +0 -98
  7. package/package.json +16 -25
  8. package/plugins/component-testing.js +3 -8
  9. package/src/builders/dev-server/dev-server.impl.js +7 -4
  10. package/src/builders/dev-server/lib/normalize-options.js +6 -0
  11. package/src/builders/dev-server/lib/validate-options.js +4 -0
  12. package/src/builders/dev-server/schema.d.ts +15 -3
  13. package/src/builders/dev-server/schema.json +9 -3
  14. package/src/builders/webpack-browser/webpack-browser.impl.js +0 -2
  15. package/src/builders/webpack-server/webpack-server.impl.d.ts +1 -3
  16. package/src/builders/webpack-server/webpack-server.impl.js +0 -2
  17. package/src/executors/application/application.impl.d.ts +2 -2
  18. package/src/executors/application/application.impl.js +6 -11
  19. package/src/executors/application/schema.d.ts +1 -1
  20. package/src/executors/application/schema.json +10 -21
  21. package/src/executors/application/utils/normalize-options.js +1 -8
  22. package/src/executors/application/utils/validate-options.js +40 -10
  23. package/src/executors/extract-i18n/extract-i18n.impl.js +14 -6
  24. package/src/executors/extract-i18n/schema.d.ts +6 -1
  25. package/src/executors/module-federation-dev-server/lib/normalize-options.js +7 -1
  26. package/src/executors/module-federation-dev-server/schema.d.ts +15 -3
  27. package/src/executors/module-federation-dev-server/schema.json +15 -2
  28. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +8 -10
  29. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts +3 -6
  30. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js +8 -46
  31. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.d.ts +1 -1
  32. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.js +3 -3
  33. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.d.ts +2 -2
  34. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +6 -22
  35. package/src/executors/ng-packagr-lite/schema.json +3 -2
  36. package/src/executors/package/package.impl.js +5 -1
  37. package/src/executors/package/schema.d.ts +1 -3
  38. package/src/executors/package/schema.json +3 -2
  39. package/src/executors/utilities/esbuild-extensions.d.ts +1 -2
  40. package/src/executors/utilities/ng-packagr/package-imports.d.ts +1 -3
  41. package/src/executors/utilities/ng-packagr/package-imports.js +2 -2
  42. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +24 -1
  43. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +105 -12
  44. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +8 -4
  45. package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts +1 -1
  46. package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +11 -18
  47. package/src/generators/add-linting/add-linting.js +0 -8
  48. package/src/generators/application/application.js +1 -21
  49. package/src/generators/application/files/base-pre18/src/favicon.ico +0 -0
  50. package/src/generators/application/files/ng-module/src/app/app.component.spec.ts__tpl__ +29 -0
  51. package/src/generators/application/files/ng-module/src/app/{app__componentFileSuffix__.ts__tpl__ → app.component.ts__tpl__} +3 -3
  52. package/src/generators/application/files/ng-module/src/app/app.module.ts__tpl__ +17 -0
  53. package/src/generators/application/files/ng-module/src/main.ts__tpl__ +3 -11
  54. package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
  55. package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
  56. package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
  57. package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
  58. package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
  59. package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/{nx-welcome__componentFileSuffix__.ts__tpl__ → nx-welcome.component.ts__tpl__} +1 -1
  60. package/src/generators/application/files/standalone-components/src/app/app.component.__style__ +0 -0
  61. package/src/generators/application/files/standalone-components/src/app/app.component.spec.ts__tpl__ +28 -0
  62. package/src/generators/application/files/standalone-components/src/app/{app__componentFileSuffix__.ts__tpl__ → app.component.ts__tpl__} +5 -5
  63. package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +2 -6
  64. package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +2 -2
  65. package/src/generators/application/lib/create-files.d.ts +1 -1
  66. package/src/generators/application/lib/create-files.js +14 -15
  67. package/src/generators/application/lib/create-project.d.ts +1 -1
  68. package/src/generators/application/lib/create-project.js +26 -119
  69. package/src/generators/application/lib/enable-strict-type-checking.js +0 -3
  70. package/src/generators/application/schema.json +1 -1
  71. package/src/generators/component/component.js +2 -13
  72. package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
  73. package/src/generators/component/lib/component.js +1 -11
  74. package/src/generators/component/lib/module.d.ts +2 -7
  75. package/src/generators/component/lib/module.js +5 -7
  76. package/src/generators/component/lib/normalize-options.js +3 -7
  77. package/src/generators/component/schema.d.ts +0 -1
  78. package/src/generators/component/schema.json +2 -6
  79. package/src/generators/convert-to-application-executor/convert-to-application-executor.js +22 -19
  80. package/src/generators/convert-to-rspack/convert-to-rspack.js +2 -6
  81. package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +1 -1
  82. package/src/generators/directive/directive.js +1 -1
  83. package/src/generators/directive/lib/normalize-options.js +2 -7
  84. package/src/generators/directive/schema.d.ts +0 -1
  85. package/src/generators/directive/schema.json +2 -10
  86. package/src/generators/host/host.js +21 -1
  87. package/src/generators/host/schema.d.ts +1 -0
  88. package/src/generators/host/schema.json +7 -1
  89. package/src/generators/init/init.js +1 -1
  90. package/src/generators/library/files/ng-module/src/index.ts__tpl__ +1 -1
  91. package/src/generators/library/files/standalone-components/src/lib/lib.routes.ts__tpl__ +2 -2
  92. package/src/generators/library/lib/add-standalone-component.js +0 -1
  93. package/src/generators/library/lib/create-files.js +1 -10
  94. package/src/generators/library/lib/enable-strict-type-checking.d.ts +1 -1
  95. package/src/generators/library/lib/enable-strict-type-checking.js +0 -3
  96. package/src/generators/library/lib/normalize-options.d.ts +3 -3
  97. package/src/generators/library/lib/normalize-options.js +1 -6
  98. package/src/generators/library/lib/normalized-schema.d.ts +0 -2
  99. package/src/generators/library-secondary-entry-point/files/src/index.ts__tmpl__ +1 -1
  100. package/src/generators/library-secondary-entry-point/lib/add-files.js +1 -2
  101. package/src/generators/library-secondary-entry-point/lib/normalize-options.d.ts +2 -2
  102. package/src/generators/library-secondary-entry-point/lib/normalize-options.js +0 -3
  103. package/src/generators/library-secondary-entry-point/schema.d.ts +0 -1
  104. package/src/generators/move/lib/update-module-name.js +10 -17
  105. package/src/generators/move/lib/update-secondary-entry-points.js +3 -0
  106. package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +1 -1
  107. package/src/generators/ng-add/migrators/projects/app.migrator.js +8 -43
  108. package/src/generators/ngrx/schema.json +3 -3
  109. package/src/generators/ngrx-root-store/lib/normalize-options.js +2 -9
  110. package/src/generators/pipe/lib/normalize-options.js +0 -4
  111. package/src/generators/pipe/pipe.js +1 -1
  112. package/src/generators/pipe/schema.d.ts +0 -1
  113. package/src/generators/pipe/schema.json +2 -11
  114. package/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +4 -4
  115. package/src/generators/remote/lib/update-ssr-setup.js +0 -5
  116. package/src/generators/remote/remote.js +23 -0
  117. package/src/generators/remote/schema.d.ts +1 -0
  118. package/src/generators/remote/schema.json +7 -1
  119. package/src/generators/scam/lib/convert-component-to-scam.js +3 -1
  120. package/src/generators/scam/lib/normalize-options.js +3 -11
  121. package/src/generators/scam/schema.d.ts +0 -1
  122. package/src/generators/scam/schema.json +2 -1
  123. package/src/generators/scam-directive/lib/convert-directive-to-scam.js +3 -1
  124. package/src/generators/scam-directive/lib/normalize-options.js +2 -11
  125. package/src/generators/scam-directive/schema.d.ts +0 -2
  126. package/src/generators/scam-directive/schema.json +2 -10
  127. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +3 -1
  128. package/src/generators/scam-pipe/lib/normalize-options.js +0 -8
  129. package/src/generators/scam-pipe/schema.d.ts +0 -2
  130. package/src/generators/scam-pipe/schema.json +0 -5
  131. package/src/generators/setup-mf/files/entry-module-files/{entry__componentFileSuffix__.ts__tmpl__ → entry.component.ts__tmpl__} +1 -1
  132. package/src/generators/setup-mf/files/entry-module-files/{__entryModuleFileName__.ts__tmpl__ → entry.module.ts__tmpl__} +4 -4
  133. package/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +2 -2
  134. package/src/generators/setup-mf/files/host-files/app.component.spec.ts__tmpl__ +47 -0
  135. package/src/generators/setup-mf/files/standalone-entry-component-files/{entry__componentFileSuffix__.ts__tmpl__ → entry.component.ts__tmpl__} +3 -3
  136. package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +2 -2
  137. package/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +1 -1
  138. package/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +1 -1
  139. package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
  140. package/src/generators/setup-mf/lib/add-remote-entry.d.ts +2 -2
  141. package/src/generators/setup-mf/lib/add-remote-entry.js +3 -9
  142. package/src/generators/setup-mf/lib/add-remote-to-host.js +1 -11
  143. package/src/generators/setup-mf/lib/fix-bootstrap.d.ts +2 -2
  144. package/src/generators/setup-mf/lib/fix-bootstrap.js +4 -4
  145. package/src/generators/setup-mf/lib/generate-config.d.ts +2 -2
  146. package/src/generators/setup-mf/lib/generate-config.js +0 -1
  147. package/src/generators/setup-mf/lib/normalize-options.d.ts +1 -1
  148. package/src/generators/setup-mf/lib/normalize-options.js +0 -13
  149. package/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +2 -2
  150. package/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +14 -18
  151. package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +5 -1
  152. package/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +2 -2
  153. package/src/generators/setup-mf/lib/setup-tspath-for-remote.js +1 -1
  154. package/src/generators/setup-mf/lib/update-host-app-routes.d.ts +2 -2
  155. package/src/generators/setup-mf/lib/update-host-app-routes.js +9 -12
  156. package/src/generators/setup-mf/lib/update-tsconfig.d.ts +2 -2
  157. package/src/generators/setup-mf/lib/update-tsconfig.js +5 -5
  158. package/src/generators/setup-mf/schema.d.ts +0 -7
  159. package/src/generators/setup-ssr/lib/add-dependencies.js +7 -4
  160. package/src/generators/setup-ssr/lib/add-hydration.js +3 -10
  161. package/src/generators/setup-ssr/lib/add-server-file.js +2 -7
  162. package/src/generators/setup-ssr/lib/generate-files.js +4 -17
  163. package/src/generators/setup-ssr/lib/generate-server-ts-config.js +2 -5
  164. package/src/generators/setup-ssr/lib/normalize-options.js +2 -2
  165. package/src/generators/setup-ssr/lib/update-project-config.js +0 -5
  166. package/src/generators/setup-ssr/lib/validate-options.js +2 -2
  167. package/src/generators/setup-ssr/schema.json +1 -1
  168. package/src/generators/utils/add-jest.js +1 -6
  169. package/src/generators/utils/assert-mf-utils.d.ts +1 -0
  170. package/src/generators/utils/assert-mf-utils.js +11 -0
  171. package/src/generators/utils/ensure-angular-dependencies.js +3 -6
  172. package/src/generators/utils/export-scam.d.ts +0 -1
  173. package/src/generators/utils/export-scam.js +2 -1
  174. package/src/generators/utils/find-module.js +13 -18
  175. package/src/generators/utils/storybook-ast/component-info.js +24 -40
  176. package/src/generators/utils/storybook-ast/module-info.d.ts +1 -1
  177. package/src/generators/utils/storybook-ast/module-info.js +8 -3
  178. package/src/generators/utils/testing.js +28 -28
  179. package/src/generators/utils/version-utils.js +2 -2
  180. package/src/generators/web-worker/lib/add-snippet.js +3 -3
  181. package/src/plugins/plugin.js +13 -22
  182. package/src/utils/backward-compatible-versions.d.ts +2 -2
  183. package/src/utils/backward-compatible-versions.js +21 -20
  184. package/src/utils/nx-devkit/ast-utils.js +3 -17
  185. package/src/utils/nx-devkit/testing.js +9 -9
  186. package/src/utils/versions.d.ts +4 -3
  187. package/src/utils/versions.js +5 -4
  188. package/src/executors/utilities/builder-package.d.ts +0 -1
  189. package/src/executors/utilities/builder-package.js +0 -11
  190. package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +0 -28
  191. package/src/generators/application/files/ng-module/src/app/app__moduleTypeSeparator__module.ts__tpl__ +0 -17
  192. package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +0 -27
  193. package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -43
  194. package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/__main__ +0 -1
  195. package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -12
  196. package/src/generators/setup-ssr/files/v20+/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -8
  197. package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +0 -66
  198. package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/__main__ +0 -7
  199. package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -12
  200. package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -8
  201. package/src/generators/setup-ssr/files/v20+/server-builder/ngmodule-src/__main__ +0 -1
  202. package/src/generators/setup-ssr/files/v20+/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -14
  203. package/src/generators/setup-ssr/files/v20+/server-builder/root/tsconfig.server.json.template +0 -16
  204. package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +0 -69
  205. package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/__main__ +0 -7
  206. package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/app/app.config.server.ts.template +0 -11
  207. package/src/generators/utils/app-components-info.d.ts +0 -9
  208. package/src/generators/utils/app-components-info.js +0 -39
  209. package/src/generators/utils/artifact-types.d.ts +0 -3
  210. package/src/generators/utils/artifact-types.js +0 -33
  211. package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.d.ts +0 -2
  212. package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.js +0 -110
  213. package/src/migrations/update-21-2-0/replace-provide-server-routing.d.ts +0 -2
  214. package/src/migrations/update-21-2-0/replace-provide-server-routing.js +0 -103
  215. package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.d.ts +0 -2
  216. package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.js +0 -47
  217. package/src/migrations/update-21-2-0/update-angular-cli.d.ts +0 -3
  218. package/src/migrations/update-21-2-0/update-angular-cli.js +0 -23
  219. /package/src/generators/application/files/{base → base-18+}/public/favicon.ico +0 -0
  220. /package/src/generators/application/files/{ng-module/src/app/app__componentFileSuffix__.__style__ → base-pre18/src/assets/.gitkeep__tpl__} +0 -0
  221. /package/src/generators/application/files/{standalone-components/src/app/app__componentFileSuffix__.__style__ → ng-module/src/app/app.component.__style__} +0 -0
  222. /package/src/generators/application/files/ng-module/src/app/{app__componentFileSuffix__.html__tpl__ → app.component.html__tpl__} +0 -0
  223. /package/src/generators/application/files/standalone-components/src/app/{app__componentFileSuffix__.html__tpl__ → app.component.html__tpl__} +0 -0
  224. /package/src/generators/component/files/{__fileName____ngext__.html__tpl__ → __fileName__.html__tpl__} +0 -0
  225. /package/src/generators/library/files/ng-module/src/lib/{__libFileName____moduleTypeSeparator__module.ts__tpl__ → __libFileName__.module.ts__tpl__} +0 -0
  226. /package/src/generators/library-secondary-entry-point/files/src/lib/{__fileName____moduleTypeSeparator__module.ts__tmpl__ → __fileName__.module.ts__tmpl__} +0 -0
  227. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/ngmodule-src/__main__ +0 -0
  228. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -0
  229. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -0
  230. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/server/__serverFileName__ +0 -0
  231. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/standalone-src/__main__ +0 -0
  232. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -0
  233. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -0
  234. /package/src/generators/setup-ssr/files/{v19 → v19+}/application-builder-common-engine/server/__serverFileName__ +0 -0
  235. /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/ngmodule-src/__main__ +0 -0
  236. /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -0
  237. /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/root/tsconfig.server.json.template +0 -0
  238. /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/server/__serverFileName__ +0 -0
  239. /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/standalone-src/__main__ +0 -0
  240. /package/src/generators/setup-ssr/files/{v19 → v19+}/server-builder/standalone-src/app/app.config.server.ts.template +0 -0
@@ -14,15 +14,15 @@ function getComponentsInfo(tree, entryPoint, moduleFilePaths, projectName) {
14
14
  return moduleFilePaths
15
15
  .flatMap((moduleFilePath) => {
16
16
  const file = (0, ast_utils_1.getTsSourceFile)(tree, moduleFilePath);
17
- const moduleDeclarations = (0, module_info_1.getModuleDeclarations)(file, moduleFilePath, projectName);
18
- if (moduleDeclarations.length === 0) {
17
+ const declaredComponents = (0, module_info_1.getModuleDeclaredComponents)(file, moduleFilePath, projectName);
18
+ if (declaredComponents.length === 0) {
19
19
  return undefined;
20
20
  }
21
21
  if (!tsModule) {
22
22
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
23
23
  }
24
24
  const imports = file.statements.filter((statement) => statement.kind === tsModule.SyntaxKind.ImportDeclaration);
25
- const componentsInfo = moduleDeclarations.map((maybeComponentName) => tryGetComponentInfo(tree, entryPoint, file, imports, moduleFilePath, maybeComponentName));
25
+ const componentsInfo = declaredComponents.map((componentName) => getComponentInfo(tree, entryPoint, file, imports, moduleFilePath, componentName));
26
26
  return componentsInfo;
27
27
  })
28
28
  .filter((f) => f !== undefined);
@@ -100,7 +100,7 @@ function getComponentImportPath(componentName, imports) {
100
100
  .slice(1, -1);
101
101
  return importPath;
102
102
  }
103
- function tryGetComponentInfo(tree, entryPoint, sourceFile, imports, moduleFilePath, symbolName) {
103
+ function getComponentInfo(tree, entryPoint, sourceFile, imports, moduleFilePath, componentName) {
104
104
  try {
105
105
  if (!tsquery) {
106
106
  (0, ensure_typescript_1.ensureTypescript)();
@@ -108,53 +108,38 @@ function tryGetComponentInfo(tree, entryPoint, sourceFile, imports, moduleFilePa
108
108
  }
109
109
  const moduleFolderPath = (0, path_1.dirname)(moduleFilePath);
110
110
  // try to get the component from the same file (inline scam)
111
- const node = tsquery(sourceFile, `ClassDeclaration:has(Decorator > CallExpression > Identifier[name=Component]):has(Identifier[name=${symbolName}])`, { visitAllChildren: true })[0];
111
+ const node = tsquery(sourceFile, `ClassDeclaration:has(Decorator > CallExpression > Identifier[name=Component]):has(Identifier[name=${componentName}])`, { visitAllChildren: true })[0];
112
112
  if (node) {
113
113
  return {
114
114
  componentFileName: (0, path_1.basename)(moduleFilePath, '.ts'),
115
115
  moduleFolderPath,
116
- name: symbolName,
116
+ name: componentName,
117
117
  path: '.',
118
118
  entryPointName: entryPoint.name,
119
119
  };
120
120
  }
121
121
  // try to get the component from the imports
122
- const symbolFilePathRelativeToModule = getComponentImportPath(symbolName, imports);
123
- let symbolImportPath = getFullComponentFilePath(moduleFolderPath, symbolFilePathRelativeToModule);
124
- if (tree.exists(symbolImportPath) && !tree.isFile(symbolImportPath)) {
125
- return tryGetComponentInfoFromDir(tree, entryPoint, symbolImportPath, symbolName, moduleFolderPath);
122
+ const componentFilePathRelativeToModule = getComponentImportPath(componentName, imports);
123
+ const componentImportPath = getFullComponentFilePath(moduleFolderPath, componentFilePathRelativeToModule);
124
+ if (tree.exists(componentImportPath) && !tree.isFile(componentImportPath)) {
125
+ return getComponentInfoFromDir(tree, entryPoint, componentImportPath, componentName, moduleFolderPath);
126
126
  }
127
- const candidatePaths = [
128
- symbolImportPath,
129
- `${symbolImportPath}.ts`,
130
- `${symbolImportPath}.js`,
131
- ];
132
- for (const candidatePath of candidatePaths) {
133
- if (!tree.exists(candidatePath)) {
134
- continue;
135
- }
136
- const content = tree.read(candidatePath, 'utf-8');
137
- const classAndComponentRegex = new RegExp(`@Component[\\s\\S\n]*?\\bclass ${symbolName}\\b`, 'g');
138
- if (content.match(classAndComponentRegex)) {
139
- const path = (0, path_1.dirname)(symbolFilePathRelativeToModule);
140
- const componentFileName = (0, path_1.basename)(symbolFilePathRelativeToModule);
141
- return {
142
- componentFileName,
143
- moduleFolderPath,
144
- name: symbolName,
145
- path,
146
- entryPointName: entryPoint.name,
147
- };
148
- }
149
- }
150
- return undefined;
127
+ const path = (0, path_1.dirname)(componentFilePathRelativeToModule);
128
+ const componentFileName = (0, path_1.basename)(componentFilePathRelativeToModule);
129
+ return {
130
+ componentFileName,
131
+ moduleFolderPath,
132
+ name: componentName,
133
+ path,
134
+ entryPointName: entryPoint.name,
135
+ };
151
136
  }
152
137
  catch (ex) {
153
- devkit_1.logger.warn(`Could not generate a story for ${symbolName}. Error: ${ex}`);
138
+ devkit_1.logger.warn(`Could not generate a story for ${componentName}. Error: ${ex}`);
154
139
  return undefined;
155
140
  }
156
141
  }
157
- function tryGetComponentInfoFromDir(tree, entryPoint, dir, symbolName, moduleFolderPath) {
142
+ function getComponentInfoFromDir(tree, entryPoint, dir, componentName, moduleFolderPath) {
158
143
  let path = null;
159
144
  let componentFileName = null;
160
145
  const componentImportPathChildren = [];
@@ -164,7 +149,7 @@ function tryGetComponentInfoFromDir(tree, entryPoint, dir, symbolName, moduleFol
164
149
  for (const candidateFile of componentImportPathChildren) {
165
150
  if (candidateFile.endsWith('.ts')) {
166
151
  const content = tree.read(candidateFile, 'utf-8');
167
- const classAndComponentRegex = new RegExp(`@Component[\\s\\S\n]*?\\bclass ${symbolName}\\b`, 'g');
152
+ const classAndComponentRegex = new RegExp(`@Component[\\s\\S\n]*?\\bclass ${componentName}\\b`, 'g');
168
153
  if (content.match(classAndComponentRegex)) {
169
154
  path = candidateFile
170
155
  .slice(0, candidateFile.lastIndexOf('/'))
@@ -175,13 +160,12 @@ function tryGetComponentInfoFromDir(tree, entryPoint, dir, symbolName, moduleFol
175
160
  }
176
161
  }
177
162
  if (path === null) {
178
- console.warn(`Couldn't resolve "${symbolName}" imported from ${dir} relative to ${moduleFolderPath}.`);
179
- return undefined;
163
+ throw new Error(`Path to component ${componentName} couldn't be found. Please open an issue on https://github.com/nrwl/nx/issues.`);
180
164
  }
181
165
  return {
182
166
  componentFileName,
183
167
  moduleFolderPath,
184
- name: symbolName,
168
+ name: componentName,
185
169
  path,
186
170
  entryPointName: entryPoint.name,
187
171
  };
@@ -1,5 +1,5 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { SourceFile } from 'typescript';
3
3
  import type { EntryPoint } from './entry-point';
4
- export declare function getModuleDeclarations(file: SourceFile, moduleFilePath: string, projectName: string): string[];
4
+ export declare function getModuleDeclaredComponents(file: SourceFile, moduleFilePath: string, projectName: string): string[];
5
5
  export declare function getModuleFilePaths(tree: Tree, entryPoint: EntryPoint): string[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getModuleDeclarations = getModuleDeclarations;
3
+ exports.getModuleDeclaredComponents = getModuleDeclaredComponents;
4
4
  exports.getModuleFilePaths = getModuleFilePaths;
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const js_1 = require("@nx/js");
@@ -8,7 +8,7 @@ const path_1 = require("path");
8
8
  const ast_utils_1 = require("../../../utils/nx-devkit/ast-utils");
9
9
  const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
10
10
  let tsModule;
11
- function getModuleDeclarations(file, moduleFilePath, projectName) {
11
+ function getModuleDeclaredComponents(file, moduleFilePath, projectName) {
12
12
  const ngModuleDecorator = getNgModuleDecorator(file, moduleFilePath);
13
13
  const declarationsPropertyAssignment = getNgModuleDeclarationsPropertyAssignment(ngModuleDecorator, moduleFilePath, projectName);
14
14
  if (!declarationsPropertyAssignment) {
@@ -18,7 +18,7 @@ function getModuleDeclarations(file, moduleFilePath, projectName) {
18
18
  if (!declarationsArray) {
19
19
  return [];
20
20
  }
21
- return getDeclaredComponentNodes(declarationsArray).map((node) => node.getText());
21
+ return getDeclaredComponentsInDeclarations(declarationsArray);
22
22
  }
23
23
  function getModuleFilePaths(tree, entryPoint) {
24
24
  let moduleFilePaths = [];
@@ -43,6 +43,11 @@ function hasNgModule(tree, filePath) {
43
43
  const ngModule = tsquery(ast, 'ClassDeclaration > Decorator > CallExpression > Identifier[name=NgModule]', { visitAllChildren: true });
44
44
  return ngModule.length > 0;
45
45
  }
46
+ function getDeclaredComponentsInDeclarations(declarationsArray) {
47
+ return getDeclaredComponentNodes(declarationsArray)
48
+ .map((node) => node.getText())
49
+ .filter((name) => name.endsWith('Component'));
50
+ }
46
51
  function getDeclaredComponentNodes(declarationsArray) {
47
52
  if (!tsModule) {
48
53
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
@@ -52,24 +52,24 @@ async function createStorybookTestWorkspaceForLib(libName) {
52
52
  standalone: false,
53
53
  skipFormat: true,
54
54
  });
55
- tree.write(`${libName}/src/lib/test-button/test-button.ts`, `import { Component, Input } from '@angular/core';
55
+ tree.write(`${libName}/src/lib/test-button/test-button.component.ts`, `import { Component, Input } from '@angular/core';
56
56
 
57
57
  export type ButtonStyle = 'default' | 'primary' | 'accent';
58
58
 
59
59
  @Component({
60
60
  selector: 'proj-test-button',
61
- templateUrl: './test-button.html',
62
- styleUrls: ['./test-button.css']
61
+ templateUrl: './test-button.component.html',
62
+ styleUrls: ['./test-button.component.css']
63
63
  })
64
- export class TestButton {
64
+ export class TestButtonComponent {
65
65
  @Input('buttonType') type = 'button';
66
66
  @Input() style: ButtonStyle = 'default';
67
67
  @Input() age?: number;
68
68
  @Input() isOn = false;
69
69
  }`);
70
- tree.write(`${libName}/src/lib/test-button/test-button.html`, `<button [attr.type]="type" [ngClass]="style"></button>`);
71
- const modulePath = `${libName}/src/lib/${libName}-module.ts`;
72
- tree.write(modulePath, `import * as ButtonExports from './test-button/test-button';
70
+ tree.write(`${libName}/src/lib/test-button/test-button.component.html`, `<button [attr.type]="type" [ngClass]="style"></button>`);
71
+ const modulePath = `${libName}/src/lib/${libName}.module.ts`;
72
+ tree.write(modulePath, `import * as ButtonExports from './test-button/test-button.component';
73
73
  ${tree.read(modulePath)}`);
74
74
  // create a module with component that gets exported in a barrel file
75
75
  generateModule(tree, {
@@ -83,14 +83,14 @@ export class TestButton {
83
83
  standalone: false,
84
84
  skipFormat: true,
85
85
  });
86
- tree.write(`${libName}/src/lib/barrel/barrel-button/index.ts`, `export * from './barrel-button';`);
87
- tree.write(`${libName}/src/lib/barrel/barrel-module.ts`, `import { NgModule } from '@angular/core';
86
+ tree.write(`${libName}/src/lib/barrel/barrel-button/index.ts`, `export * from './barrel-button.component';`);
87
+ tree.write(`${libName}/src/lib/barrel/barrel.module.ts`, `import { NgModule } from '@angular/core';
88
88
  import { CommonModule } from '@angular/common';
89
- import { BarrelButton } from './barrel-button';
89
+ import { BarrelButtonComponent } from './barrel-button';
90
90
 
91
91
  @NgModule({
92
92
  imports: [CommonModule],
93
- declarations: [BarrelButton],
93
+ declarations: [BarrelButtonComponent],
94
94
  })
95
95
  export class BarrelModule {}`);
96
96
  // create a module with components that get Angular exported and declared by variable
@@ -112,14 +112,14 @@ export class BarrelModule {}`);
112
112
  standalone: false,
113
113
  skipFormat: true,
114
114
  });
115
- tree.write(`${libName}/src/lib/variable-declare/variable-declare-module.ts`, `import { NgModule } from '@angular/core';
115
+ tree.write(`${libName}/src/lib/variable-declare/variable-declare.module.ts`, `import { NgModule } from '@angular/core';
116
116
  import { CommonModule } from '@angular/common';
117
- import { VariableDeclareButton } from './variable-declare-button/variable-declare-button';
118
- import { VariableDeclareView } from './variable-declare-view/variable-declare-view';
117
+ import { VariableDeclareButtonComponent } from './variable-declare-button/variable-declare-button.component';
118
+ import { VariableDeclareViewComponent } from './variable-declare-view/variable-declare-view.component';
119
119
 
120
120
  const COMPONENTS = [
121
- VariableDeclareButton,
122
- VariableDeclareView
121
+ VariableDeclareButtonComponent,
122
+ VariableDeclareViewComponent
123
123
  ]
124
124
 
125
125
  @NgModule({
@@ -154,20 +154,20 @@ export class VariableDeclareModule {}`);
154
154
  standalone: false,
155
155
  skipFormat: true,
156
156
  });
157
- tree.write(`${libName}/src/lib/variable-spread-declare/variable-spread-declare-module.ts`, `import { NgModule } from '@angular/core';
157
+ tree.write(`${libName}/src/lib/variable-spread-declare/variable-spread-declare.module.ts`, `import { NgModule } from '@angular/core';
158
158
  import { CommonModule } from '@angular/common';
159
- import { VariableSpreadDeclareButton } from './variable-spread-declare-button/variable-spread-declare-button';
160
- import { VariableSpreadDeclareView } from './variable-spread-declare-view/variable-spread-declare-view';
161
- import { VariableSpreadDeclareAnotherview } from './variable-spread-declare-anotherview/variable-spread-declare-anotherview';
159
+ import { VariableSpreadDeclareButtonComponent } from './variable-spread-declare-button/variable-spread-declare-button.component';
160
+ import { VariableSpreadDeclareViewComponent } from './variable-spread-declare-view/variable-spread-declare-view.component';
161
+ import { VariableSpreadDeclareAnotherviewComponent } from './variable-spread-declare-anotherview/variable-spread-declare-anotherview.component';
162
162
 
163
163
  const COMPONENTS = [
164
- VariableSpreadDeclareButton,
165
- VariableSpreadDeclareView
164
+ VariableSpreadDeclareButtonComponent,
165
+ VariableSpreadDeclareViewComponent
166
166
  ]
167
167
 
168
168
  @NgModule({
169
169
  imports: [CommonModule],
170
- declarations: [...COMPONENTS, VariableSpreadDeclareAnotherview],
170
+ declarations: [...COMPONENTS, VariableSpreadDeclareAnotherviewComponent],
171
171
  })
172
172
  export class VariableSpreadDeclareModule {}`);
173
173
  // create a module where declared components are pulled from a static member of the module
@@ -189,10 +189,10 @@ export class VariableSpreadDeclareModule {}`);
189
189
  standalone: false,
190
190
  skipFormat: true,
191
191
  });
192
- tree.write(`${libName}/src/lib/static-member-declarations/static-member-declarations-module.ts`, `import { NgModule } from '@angular/core';
192
+ tree.write(`${libName}/src/lib/static-member-declarations/static-member-declarations.module.ts`, `import { NgModule } from '@angular/core';
193
193
  import { CommonModule } from '@angular/common';
194
- import { Cmp1 } from './cmp1/cmp1';
195
- import { Cmp2 } from './cmp2/cmp2';
194
+ import { Cmp1Component } from './cmp1/cmp1.component';
195
+ import { Cmp2Component } from './cmp2/cmp2.component';
196
196
 
197
197
  @NgModule({
198
198
  imports: [CommonModule],
@@ -200,7 +200,7 @@ import { Cmp2 } from './cmp2/cmp2';
200
200
  exports: StaticMemberDeclarationsModule.COMPONENTS
201
201
  })
202
202
  export class StaticMemberDeclarationsModule {
203
- static readonly COMPONENTS = [Cmp1, Cmp2];
203
+ static readonly COMPONENTS = [Cmp1Component, Cmp2Component];
204
204
  }`);
205
205
  // create another button in a nested subpath
206
206
  generateModule(tree, {
@@ -231,7 +231,7 @@ function generateModule(tree, options) {
231
231
  options.path = `${sourceRoot}/${projectDirName}`;
232
232
  }
233
233
  const moduleNames = (0, devkit_1.names)(options.name);
234
- const moduleFilePath = `${options.path}/${moduleNames.fileName}/${moduleNames.fileName}-module.ts`;
234
+ const moduleFilePath = `${options.path}/${moduleNames.fileName}/${moduleNames.fileName}.module.ts`;
235
235
  tree.write(moduleFilePath, `import { NgModule } from '@angular/core';
236
236
  import { CommonModule } from '@angular/common';
237
237
 
@@ -49,10 +49,10 @@ function getInstalledPackageVersionInfo(tree, pkgName) {
49
49
  function versions(tree) {
50
50
  const majorAngularVersion = getInstalledAngularMajorVersion(tree);
51
51
  switch (majorAngularVersion) {
52
+ case 17:
53
+ return backward_compatible_versions_1.backwardCompatibleVersions.angularV17;
52
54
  case 18:
53
55
  return backward_compatible_versions_1.backwardCompatibleVersions.angularV18;
54
- case 19:
55
- return backward_compatible_versions_1.backwardCompatibleVersions.angularV19;
56
56
  default:
57
57
  return latestVersions;
58
58
  }
@@ -4,9 +4,9 @@ exports.addSnippet = addSnippet;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  function addSnippet(tree, name, path) {
6
6
  const fileRegExp = new RegExp(`^${name}.*\\.ts`);
7
- const siblingModules = tree
8
- .children(path)
9
- .filter((f) => fileRegExp.test(f) && !/(module|spec|config|routes)\.ts$/.test(f))
7
+ const children = tree.children(path);
8
+ const siblingModules = children
9
+ .filter((f) => fileRegExp.test(f) && !/(module|spec)\.ts$/.test(f))
10
10
  .sort();
11
11
  if (siblingModules.length === 0) {
12
12
  return;
@@ -21,14 +21,8 @@ const knownExecutors = {
21
21
  '@angular-devkit/build-angular:ng-packagr',
22
22
  '@angular/build:ng-packagr',
23
23
  ]),
24
- devServer: new Set([
25
- '@angular-devkit/build-angular:dev-server',
26
- '@angular/build:dev-server',
27
- ]),
28
- extractI18n: new Set([
29
- '@angular-devkit/build-angular:extract-i18n',
30
- '@angular/build:extract-i18n',
31
- ]),
24
+ devServer: new Set(['@angular-devkit/build-angular:dev-server']),
25
+ extractI18n: new Set(['@angular-devkit/build-angular:extract-i18n']),
32
26
  prerender: new Set([
33
27
  '@angular-devkit/build-angular:prerender',
34
28
  '@nguniversal/builders:prerender',
@@ -38,10 +32,7 @@ const knownExecutors = {
38
32
  '@angular-devkit/build-angular:ssr-dev-server',
39
33
  '@nguniversal/builders:ssr-dev-server',
40
34
  ]),
41
- test: new Set([
42
- '@angular-devkit/build-angular:karma',
43
- '@angular/build:karma',
44
- ]),
35
+ test: new Set(['@angular-devkit/build-angular:karma']),
45
36
  };
46
37
  const pmc = (0, devkit_1.getPackageManagerCommand)();
47
38
  function readProjectsCache(cachePath) {
@@ -120,7 +111,7 @@ async function buildAngularProjects(configFilePath, options, angularWorkspaceRoo
120
111
  appShellTargets.push({ target: nxTargetName, project: projectName });
121
112
  }
122
113
  else if (knownExecutors.build.has(angularTarget.builder)) {
123
- await updateBuildTarget(projectName, nxTargetName, targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs);
114
+ await updateBuildTarget(nxTargetName, targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs);
124
115
  }
125
116
  else if (knownExecutors.devServer.has(angularTarget.builder)) {
126
117
  targets[nxTargetName].continuous = true;
@@ -205,21 +196,21 @@ function updateAppShellTarget(projectName, targetName, projects, angularJson, an
205
196
  target.inputs = inputs;
206
197
  target.outputs = outputs;
207
198
  }
208
- async function updateBuildTarget(projectName, targetName, target, angularTarget, context, angularWorkspaceRoot, projectRoot, namedInputs) {
199
+ async function updateBuildTarget(targetName, target, angularTarget, context, angularWorkspaceRoot, projectRoot, namedInputs) {
209
200
  target.dependsOn = [`^${targetName}`];
210
- if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
201
+ if (angularTarget.options?.outputPath) {
202
+ const fullOutputPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, angularTarget.options.outputPath);
203
+ target.outputs = [
204
+ getOutput(fullOutputPath, context.workspaceRoot, angularWorkspaceRoot, projectRoot),
205
+ ];
206
+ }
207
+ else if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
211
208
  angularTarget.builder === '@angular/build:ng-packagr') {
212
209
  const outputs = await getNgPackagrOutputs(angularTarget, angularWorkspaceRoot, projectRoot, context);
213
210
  if (outputs.length) {
214
211
  target.outputs = outputs;
215
212
  }
216
213
  }
217
- else {
218
- const fullOutputPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, angularTarget.options?.outputPath ?? posix.join('dist', projectName));
219
- target.outputs = [
220
- getOutput(fullOutputPath, context.workspaceRoot, angularWorkspaceRoot, projectRoot),
221
- ];
222
- }
223
214
  if (target.outputs?.length) {
224
215
  // make it cacheable if we were able to identify outputs
225
216
  target.cache = true;
@@ -281,7 +272,7 @@ function updatePrerenderTarget(projectName, targetName, projects, angularJson) {
281
272
  target.outputs = outputs;
282
273
  }
283
274
  async function getNgPackagrOutputs(target, angularWorkspaceRoot, projectRoot, context) {
284
- let ngPackageJsonPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, target.options?.project ?? (0, node_path_1.join)(projectRoot, 'ng-package.json'));
275
+ let ngPackageJsonPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, target.options.project);
285
276
  const readConfig = async (configPath) => {
286
277
  if (!(0, node_fs_1.existsSync)(configPath)) {
287
278
  return undefined;
@@ -1,11 +1,11 @@
1
1
  import * as latestVersions from './versions';
2
- type SupportedVersions = 'angularV18' | 'angularV19';
2
+ type SupportedVersions = 'angularV17' | 'angularV18';
3
3
  type LatestPackageVersionNames = Exclude<keyof typeof latestVersions, 'nxVersion'>;
4
4
  type CompatPackageVersionNames = LatestPackageVersionNames;
5
5
  export type PackageVersionNames = LatestPackageVersionNames | CompatPackageVersionNames;
6
6
  export type VersionMap = {
7
+ angularV17: Record<Exclude<CompatPackageVersionNames, 'typescriptEslintVersion'>, string>;
7
8
  angularV18: Record<CompatPackageVersionNames, string>;
8
- angularV19: Record<CompatPackageVersionNames, string>;
9
9
  };
10
10
  export type PackageLatestVersions = Record<LatestPackageVersionNames, string>;
11
11
  export type PackageCompatVersions = VersionMap[SupportedVersions];
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.backwardCompatibleVersions = void 0;
4
4
  exports.backwardCompatibleVersions = {
5
- angularV18: {
6
- angularVersion: '~18.2.0',
7
- angularDevkitVersion: '~18.2.0',
8
- ngPackagrVersion: '~18.2.0',
5
+ angularV17: {
6
+ angularVersion: '~17.3.0',
7
+ angularDevkitVersion: '~17.3.0',
8
+ ngPackagrVersion: '~17.3.0',
9
9
  angularRspackVersion: '~20.6.1',
10
- ngrxVersion: '~18.0.2',
10
+ ngrxVersion: '~17.0.0',
11
11
  rxjsVersion: '~7.8.0',
12
12
  zoneJsVersion: '~0.14.3',
13
13
  angularJsVersion: '1.7.9',
@@ -17,28 +17,28 @@ exports.backwardCompatibleVersions = {
17
17
  expressVersion: '^4.21.2',
18
18
  typesExpressVersion: '^4.17.21',
19
19
  browserSyncVersion: '^3.0.0',
20
- moduleFederationNodeVersion: '~2.5.0',
21
- moduleFederationEnhancedVersion: '0.6.9',
22
- angularEslintVersion: '^18.3.0',
23
- typescriptEslintVersion: '^7.16.0',
20
+ moduleFederationNodeVersion: '~2.3.0',
21
+ moduleFederationEnhancedVersion: '~0.2.3',
22
+ angularEslintVersion: '~17.3.0',
24
23
  tailwindVersion: '^3.0.2',
25
24
  postcssVersion: '^8.4.5',
26
25
  postcssUrlVersion: '~10.1.3',
27
26
  autoprefixerVersion: '^10.4.0',
28
27
  tsNodeVersion: '10.9.1',
29
- jestPresetAngularVersion: '~14.1.0',
28
+ jestPresetAngularVersion: '~14.0.3',
30
29
  typesNodeVersion: '18.16.9',
31
30
  jasmineMarblesVersion: '^0.9.2',
32
31
  jsoncEslintParserVersion: '^2.1.0',
32
+ webpackMergeVersion: '^5.8.0',
33
33
  },
34
- angularV19: {
35
- angularVersion: '~19.2.0',
36
- angularDevkitVersion: '~19.2.0',
37
- ngPackagrVersion: '~19.2.0',
34
+ angularV18: {
35
+ angularVersion: '~18.2.0',
36
+ angularDevkitVersion: '~18.2.0',
37
+ ngPackagrVersion: '~18.2.0',
38
38
  angularRspackVersion: '~20.6.1',
39
- ngrxVersion: '~19.1.0',
39
+ ngrxVersion: '~18.0.2',
40
40
  rxjsVersion: '~7.8.0',
41
- zoneJsVersion: '~0.15.0',
41
+ zoneJsVersion: '~0.14.3',
42
42
  angularJsVersion: '1.7.9',
43
43
  tsLibVersion: '^2.3.0',
44
44
  corsVersion: '~2.8.5',
@@ -46,18 +46,19 @@ exports.backwardCompatibleVersions = {
46
46
  expressVersion: '^4.21.2',
47
47
  typesExpressVersion: '^4.17.21',
48
48
  browserSyncVersion: '^3.0.0',
49
- moduleFederationNodeVersion: '^2.6.26',
50
- moduleFederationEnhancedVersion: '^0.9.0',
51
- angularEslintVersion: '^19.2.0',
49
+ moduleFederationNodeVersion: '~2.5.0',
50
+ moduleFederationEnhancedVersion: '0.6.9',
51
+ angularEslintVersion: '^18.3.0',
52
52
  typescriptEslintVersion: '^7.16.0',
53
53
  tailwindVersion: '^3.0.2',
54
54
  postcssVersion: '^8.4.5',
55
55
  postcssUrlVersion: '~10.1.3',
56
56
  autoprefixerVersion: '^10.4.0',
57
57
  tsNodeVersion: '10.9.1',
58
- jestPresetAngularVersion: '~14.4.0',
58
+ jestPresetAngularVersion: '~14.1.0',
59
59
  typesNodeVersion: '18.16.9',
60
60
  jasmineMarblesVersion: '^0.9.2',
61
61
  jsoncEslintParserVersion: '^2.1.0',
62
+ webpackMergeVersion: '^5.8.0',
62
63
  },
63
64
  };
@@ -444,18 +444,9 @@ function getListOfRoutes(source) {
444
444
  }
445
445
  function isNgStandaloneApp(tree, projectName) {
446
446
  const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
447
- let mainFile = project.targets?.build?.options?.main ??
447
+ const mainFile = project.targets?.build?.options?.main ??
448
448
  project.targets?.build?.options?.browser;
449
- let hasMainFile = false;
450
- if (mainFile) {
451
- hasMainFile = true;
452
- }
453
- else {
454
- const sourceRoot = project.sourceRoot ?? (0, devkit_1.joinPathFragments)(project.root, 'src');
455
- mainFile = (0, devkit_1.joinPathFragments)(sourceRoot, 'main.ts');
456
- hasMainFile = tree.exists(mainFile);
457
- }
458
- if (project.projectType !== 'application' || !hasMainFile) {
449
+ if (project.projectType !== 'application' || !mainFile) {
459
450
  return false;
460
451
  }
461
452
  (0, ensure_typescript_1.ensureTypescript)();
@@ -557,12 +548,7 @@ function readBootstrapInfo(host, app) {
557
548
  let mainPath;
558
549
  try {
559
550
  mainPath =
560
- config.targets.build.options?.main ??
561
- config.targets.build.options?.browser;
562
- if (!mainPath) {
563
- const sourceRoot = config.sourceRoot ?? (0, devkit_1.joinPathFragments)(config.root, 'src');
564
- mainPath = (0, devkit_1.joinPathFragments)(sourceRoot, 'main.ts');
565
- }
551
+ config.targets.build.options.main ?? config.targets.build.options.browser;
566
552
  }
567
553
  catch (e) {
568
554
  throw new Error('Main file cannot be located');
@@ -18,24 +18,24 @@ function createApp(tree, appName, routing = true) {
18
18
  // save for getAppDir() lookup by external *.spec.ts tests
19
19
  appConfig = {
20
20
  appName,
21
- appModule: `${appName}/src/app/app-module.ts`,
21
+ appModule: `${appName}/src/app/app.module.ts`,
22
22
  };
23
23
  tree.write(appConfig.appModule, `import { NgModule } from '@angular/core';
24
24
  import { BrowserModule } from '@angular/platform-browser';
25
25
  ${routing ? "import { RouterModule } from '@angular/router'" : ''};
26
- import { App } from './app';
26
+ import { AppComponent } from './app.component';
27
27
  @NgModule({
28
28
  imports: [BrowserModule, ${routing ? 'RouterModule.forRoot([])' : ''}],
29
- declarations: [App],
30
- bootstrap: [App]
29
+ declarations: [AppComponent],
30
+ bootstrap: [AppComponent]
31
31
  })
32
32
  export class AppModule {}
33
33
  `);
34
- tree.write(`${appName}/src/main.ts`, `import { platformBrowser } from '@angular/platform-browser';
34
+ tree.write(`${appName}/src/main.ts`, `import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35
35
 
36
- import { AppModule } from './app/app-module';
36
+ import { AppModule } from './app/app.module';
37
37
 
38
- platformBrowser()
38
+ platformBrowserDynamic()
39
39
  .bootstrapModule(AppModule)
40
40
  .catch(err => console.log(err));
41
41
  `);
@@ -65,7 +65,7 @@ function createLib(tree, libName) {
65
65
  const { name, className, fileName, propertyName } = (0, devkit_1.names)(libName);
66
66
  libConfig = {
67
67
  name,
68
- module: `${propertyName}/src/lib/${fileName}-module.ts`,
68
+ module: `${propertyName}/src/lib/${fileName}.module.ts`,
69
69
  barrel: `${propertyName}/src/index.ts`,
70
70
  };
71
71
  tree.write(libConfig.module, `import { NgModule } from '@angular/core';
@@ -78,6 +78,6 @@ import { CommonModule } from '@angular/common';
78
78
  })
79
79
  export class ${className}Module { }
80
80
  `);
81
- tree.write(libConfig.barrel, `export * from './lib/${fileName}-module';
81
+ tree.write(libConfig.barrel, `export * from './lib/${fileName}.module';
82
82
  `);
83
83
  }
@@ -1,7 +1,7 @@
1
1
  export declare const nxVersion: any;
2
- export declare const angularVersion = "20.0.0-rc.1";
3
- export declare const angularDevkitVersion = "20.0.0-rc.2";
4
- export declare const ngPackagrVersion = "20.0.0-rc.0";
2
+ export declare const angularVersion = "~19.2.0";
3
+ export declare const angularDevkitVersion = "~19.2.0";
4
+ export declare const ngPackagrVersion = "~19.2.0";
5
5
  export declare const angularRspackVersion = "^21.0.1";
6
6
  export declare const ngrxVersion = "^19.0.0";
7
7
  export declare const rxjsVersion = "~7.8.0";
@@ -15,6 +15,7 @@ export declare const typesExpressVersion = "^4.17.21";
15
15
  export declare const browserSyncVersion = "^3.0.0";
16
16
  export declare const moduleFederationNodeVersion = "^2.6.26";
17
17
  export declare const moduleFederationEnhancedVersion = "^0.9.0";
18
+ export declare const webpackMergeVersion = "^5.8.0";
18
19
  export declare const angularEslintVersion = "^19.2.0";
19
20
  export declare const typescriptEslintVersion = "^7.16.0";
20
21
  export declare const tailwindVersion = "^3.0.2";
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
3
+ exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.angularVersion = '20.0.0-rc.1';
6
- exports.angularDevkitVersion = '20.0.0-rc.2';
7
- exports.ngPackagrVersion = '20.0.0-rc.0';
5
+ exports.angularVersion = '~19.2.0';
6
+ exports.angularDevkitVersion = '~19.2.0';
7
+ exports.ngPackagrVersion = '~19.2.0';
8
8
  exports.angularRspackVersion = '^21.0.1';
9
9
  exports.ngrxVersion = '^19.0.0';
10
10
  exports.rxjsVersion = '~7.8.0';
@@ -18,6 +18,7 @@ exports.typesExpressVersion = '^4.17.21';
18
18
  exports.browserSyncVersion = '^3.0.0';
19
19
  exports.moduleFederationNodeVersion = '^2.6.26';
20
20
  exports.moduleFederationEnhancedVersion = '^0.9.0';
21
+ exports.webpackMergeVersion = '^5.8.0';
21
22
  exports.angularEslintVersion = '^19.2.0';
22
23
  exports.typescriptEslintVersion = '^7.16.0';
23
24
  exports.tailwindVersion = '^3.0.2';
@@ -1 +0,0 @@
1
- export declare function assertBuilderPackageIsInstalled(packageName: string): void;