@nx/angular 22.3.0-canary.20251209-6092031 → 22.3.0-canary.20251215-e864b6a

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 (254) hide show
  1. package/executors.json +5 -0
  2. package/migrations.json +200 -291
  3. package/package.json +18 -18
  4. package/src/builders/dev-server/lib/normalize-options.d.ts.map +1 -1
  5. package/src/builders/dev-server/lib/normalize-options.js +1 -3
  6. package/src/builders/dev-server/lib/validate-options.d.ts.map +1 -1
  7. package/src/builders/dev-server/lib/validate-options.js +6 -5
  8. package/src/builders/dev-server/schema.d.ts +1 -0
  9. package/src/builders/dev-server/schema.json +9 -2
  10. package/src/executors/application/application.impl.js +1 -1
  11. package/src/executors/application/schema.json +11 -9
  12. package/src/executors/application/utils/normalize-options.d.ts.map +1 -1
  13. package/src/executors/application/utils/normalize-options.js +1 -27
  14. package/src/executors/application/utils/validate-options.d.ts.map +1 -1
  15. package/src/executors/application/utils/validate-options.js +0 -17
  16. package/src/executors/browser-esbuild/browser-esbuild.impl.js +1 -1
  17. package/src/executors/extract-i18n/extract-i18n.impl.js +1 -1
  18. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.d.ts.map +1 -1
  19. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +24 -23
  20. package/src/executors/unit-test/schema.d.ts +7 -0
  21. package/src/executors/unit-test/schema.json +320 -0
  22. package/src/executors/unit-test/unit-test.impl.d.ts +5 -0
  23. package/src/executors/unit-test/unit-test.impl.d.ts.map +1 -0
  24. package/src/executors/unit-test/unit-test.impl.js +111 -0
  25. package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts.map +1 -0
  26. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts.map +1 -1
  27. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +2 -6
  28. package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.js → stylesheet-processor.js} +2 -2
  29. package/src/generators/application/application.d.ts +1 -1
  30. package/src/generators/application/application.d.ts.map +1 -1
  31. package/src/generators/application/application.js +6 -1
  32. package/src/generators/application/files/base/tsconfig.app.json__tpl__ +2 -4
  33. package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
  34. package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__ +2 -2
  35. package/src/generators/application/files/ng-module/src/main.ts__tpl__ +1 -3
  36. package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
  37. package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
  38. package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
  39. package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
  40. package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
  41. package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
  42. package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +6 -0
  43. package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
  44. package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
  45. package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.ts__tpl__ +1 -2
  46. package/src/generators/application/lib/add-unit-test-runner.d.ts +1 -1
  47. package/src/generators/application/lib/add-unit-test-runner.d.ts.map +1 -1
  48. package/src/generators/application/lib/add-unit-test-runner.js +13 -2
  49. package/src/generators/application/lib/create-files.d.ts.map +1 -1
  50. package/src/generators/application/lib/create-files.js +1 -3
  51. package/src/generators/application/lib/create-project.js +12 -10
  52. package/src/generators/application/lib/enable-strict-type-checking.js +1 -1
  53. package/src/generators/application/lib/index.d.ts +2 -1
  54. package/src/generators/application/lib/index.d.ts.map +1 -1
  55. package/src/generators/application/lib/index.js +2 -1
  56. package/src/generators/application/lib/normalize-options.d.ts.map +1 -1
  57. package/src/generators/application/lib/normalize-options.js +12 -2
  58. package/src/generators/application/lib/update-tsconfig-files.d.ts.map +1 -1
  59. package/src/generators/application/lib/update-tsconfig-files.js +6 -17
  60. package/src/generators/application/lib/validate-options.d.ts +4 -0
  61. package/src/generators/application/lib/validate-options.d.ts.map +1 -0
  62. package/src/generators/application/lib/validate-options.js +26 -0
  63. package/src/generators/application/schema.d.ts +1 -0
  64. package/src/generators/application/schema.json +7 -4
  65. package/src/generators/component/component.d.ts.map +1 -1
  66. package/src/generators/component/component.js +4 -3
  67. package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
  68. package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
  69. package/src/generators/component-test/component-test.d.ts +3 -3
  70. package/src/generators/component-test/component-test.d.ts.map +1 -1
  71. package/src/generators/component-test/component-test.js +9 -0
  72. package/src/generators/component-test/schema.d.ts +1 -0
  73. package/src/generators/component-test/schema.json +6 -0
  74. package/src/generators/convert-to-rspack/convert-to-rspack.d.ts.map +1 -1
  75. package/src/generators/convert-to-rspack/convert-to-rspack.js +1 -4
  76. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
  77. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +80 -33
  78. package/src/generators/cypress-component-configuration/schema.d.ts +1 -0
  79. package/src/generators/cypress-component-configuration/schema.json +6 -0
  80. package/src/generators/directive/directive.d.ts.map +1 -1
  81. package/src/generators/directive/directive.js +0 -3
  82. package/src/generators/directive/files/__fileName__.ts__tpl__ +1 -1
  83. package/src/generators/federate-module/federate-module.d.ts +1 -1
  84. package/src/generators/federate-module/federate-module.d.ts.map +1 -1
  85. package/src/generators/federate-module/federate-module.js +8 -0
  86. package/src/generators/federate-module/lib/add-remote.js +1 -1
  87. package/src/generators/federate-module/schema.d.ts +2 -2
  88. package/src/generators/federate-module/schema.json +3 -4
  89. package/src/generators/host/files/common/src/main.server.ts__tmpl__ +8 -1
  90. package/src/generators/host/host.d.ts.map +1 -1
  91. package/src/generators/host/host.js +5 -1
  92. package/src/generators/host/lib/index.d.ts +1 -0
  93. package/src/generators/host/lib/index.d.ts.map +1 -1
  94. package/src/generators/host/lib/index.js +1 -0
  95. package/src/generators/host/lib/update-ssr-setup.d.ts.map +1 -1
  96. package/src/generators/host/lib/update-ssr-setup.js +6 -4
  97. package/src/generators/host/lib/validate-options.d.ts +4 -0
  98. package/src/generators/host/lib/validate-options.d.ts.map +1 -0
  99. package/src/generators/host/lib/validate-options.js +12 -0
  100. package/src/generators/host/schema.d.ts +2 -2
  101. package/src/generators/host/schema.json +5 -6
  102. package/src/generators/library/files/base/tsconfig.lib.json__tpl__ +3 -5
  103. package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
  104. package/src/generators/library/lib/normalize-options.js +10 -3
  105. package/src/generators/library/lib/update-tsconfig-files.d.ts.map +1 -1
  106. package/src/generators/library/lib/update-tsconfig-files.js +15 -6
  107. package/src/generators/library/lib/validate-options.d.ts +4 -0
  108. package/src/generators/library/lib/validate-options.d.ts.map +1 -0
  109. package/src/generators/library/lib/validate-options.js +27 -0
  110. package/src/generators/library/library.d.ts.map +1 -1
  111. package/src/generators/library/library.js +20 -13
  112. package/src/generators/library/schema.json +3 -4
  113. package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts +16 -0
  114. package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts.map +1 -0
  115. package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.js +161 -0
  116. package/src/generators/ng-add/migrators/builders/index.d.ts +1 -0
  117. package/src/generators/ng-add/migrators/builders/index.d.ts.map +1 -1
  118. package/src/generators/ng-add/migrators/builders/index.js +1 -0
  119. package/src/generators/ng-add/migrators/projects/app.migrator.d.ts.map +1 -1
  120. package/src/generators/ng-add/migrators/projects/app.migrator.js +1 -0
  121. package/src/generators/ng-add/migrators/projects/lib.migrator.d.ts.map +1 -1
  122. package/src/generators/ng-add/migrators/projects/lib.migrator.js +1 -0
  123. package/src/generators/pipe/files/__fileName__.ts__tpl__ +1 -1
  124. package/src/generators/pipe/pipe.d.ts.map +1 -1
  125. package/src/generators/pipe/pipe.js +0 -5
  126. package/src/generators/remote/files/common/src/main.server.ts__tmpl__ +8 -1
  127. package/src/generators/remote/lib/index.d.ts +1 -0
  128. package/src/generators/remote/lib/index.d.ts.map +1 -1
  129. package/src/generators/remote/lib/index.js +1 -0
  130. package/src/generators/remote/lib/update-ssr-setup.d.ts +2 -1
  131. package/src/generators/remote/lib/update-ssr-setup.d.ts.map +1 -1
  132. package/src/generators/remote/lib/update-ssr-setup.js +7 -7
  133. package/src/generators/remote/lib/validate-options.d.ts +4 -0
  134. package/src/generators/remote/lib/validate-options.d.ts.map +1 -0
  135. package/src/generators/remote/lib/validate-options.js +12 -0
  136. package/src/generators/remote/remote.d.ts.map +1 -1
  137. package/src/generators/remote/remote.js +6 -1
  138. package/src/generators/remote/schema.d.ts +2 -2
  139. package/src/generators/remote/schema.json +5 -6
  140. package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +1 -1
  141. package/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +2 -2
  142. package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +5 -6
  143. package/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +1 -2
  144. package/src/generators/setup-mf/lib/add-remote-entry.d.ts.map +1 -1
  145. package/src/generators/setup-mf/lib/add-remote-entry.js +0 -5
  146. package/src/generators/setup-mf/lib/update-host-app-routes.d.ts.map +1 -1
  147. package/src/generators/setup-mf/lib/update-host-app-routes.js +9 -6
  148. package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +2 -2
  149. package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +6 -0
  150. package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
  151. package/src/generators/setup-ssr/lib/add-hydration.js +2 -8
  152. package/src/generators/setup-ssr/lib/add-server-file.d.ts.map +1 -1
  153. package/src/generators/setup-ssr/lib/add-server-file.js +7 -7
  154. package/src/generators/setup-ssr/lib/generate-files.d.ts.map +1 -1
  155. package/src/generators/setup-ssr/lib/generate-files.js +2 -7
  156. package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts.map +1 -1
  157. package/src/generators/setup-ssr/lib/generate-server-ts-config.js +26 -12
  158. package/src/generators/setup-ssr/lib/normalize-options.d.ts.map +1 -1
  159. package/src/generators/setup-ssr/lib/normalize-options.js +1 -5
  160. package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
  161. package/src/generators/setup-ssr/lib/update-project-config.js +6 -17
  162. package/src/generators/setup-ssr/lib/validate-options.d.ts.map +1 -1
  163. package/src/generators/setup-ssr/lib/validate-options.js +9 -0
  164. package/src/generators/utils/add-jest.d.ts +2 -0
  165. package/src/generators/utils/add-jest.d.ts.map +1 -1
  166. package/src/generators/utils/add-jest.js +41 -11
  167. package/src/generators/utils/add-vitest.d.ts +11 -2
  168. package/src/generators/utils/add-vitest.d.ts.map +1 -1
  169. package/src/generators/utils/add-vitest.js +173 -6
  170. package/src/generators/utils/assert-mf-utils.d.ts +1 -1
  171. package/src/generators/utils/assert-mf-utils.d.ts.map +1 -1
  172. package/src/generators/utils/assert-mf-utils.js +1 -4
  173. package/src/generators/utils/ensure-angular-dependencies.d.ts +1 -1
  174. package/src/generators/utils/ensure-angular-dependencies.d.ts.map +1 -1
  175. package/src/generators/utils/ensure-angular-dependencies.js +6 -4
  176. package/src/generators/utils/storybook-ast/component-info.js +2 -10
  177. package/src/generators/utils/tsconfig-utils.d.ts +13 -0
  178. package/src/generators/utils/tsconfig-utils.d.ts.map +1 -0
  179. package/src/generators/utils/tsconfig-utils.js +29 -0
  180. package/src/generators/utils/version-utils.d.ts +13 -3
  181. package/src/generators/utils/version-utils.d.ts.map +1 -1
  182. package/src/generators/utils/version-utils.js +11 -18
  183. package/src/migrations/update-21-2-0/update-module-resolution.d.ts.map +1 -1
  184. package/src/migrations/update-21-2-0/update-module-resolution.js +17 -4
  185. package/src/migrations/update-22-3-0/update-angular-cli.d.ts +4 -0
  186. package/src/migrations/update-22-3-0/update-angular-cli.d.ts.map +1 -0
  187. package/src/migrations/{update-16-4-0 → update-22-3-0}/update-angular-cli.js +1 -1
  188. package/src/migrations/update-22-3-0/update-module-resolution.d.ts +3 -0
  189. package/src/migrations/update-22-3-0/update-module-resolution.d.ts.map +1 -0
  190. package/src/migrations/update-22-3-0/update-module-resolution.js +61 -0
  191. package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts +3 -0
  192. package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts.map +1 -0
  193. package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +111 -0
  194. package/src/migrations/update-22-3-0/update-typescript-lib.d.ts +3 -0
  195. package/src/migrations/update-22-3-0/update-typescript-lib.d.ts.map +1 -0
  196. package/src/migrations/update-22-3-0/update-typescript-lib.js +98 -0
  197. package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts +3 -0
  198. package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts.map +1 -0
  199. package/src/migrations/update-22-3-0/update-unit-test-runner-option.js +44 -0
  200. package/src/plugins/plugin.d.ts.map +1 -1
  201. package/src/plugins/plugin.js +40 -24
  202. package/src/utils/backward-compatible-versions.d.ts +7 -9
  203. package/src/utils/backward-compatible-versions.d.ts.map +1 -1
  204. package/src/utils/backward-compatible-versions.js +20 -14
  205. package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
  206. package/src/utils/nx-devkit/ast-utils.js +2 -13
  207. package/src/utils/targets.d.ts +6 -1
  208. package/src/utils/targets.d.ts.map +1 -1
  209. package/src/utils/targets.js +20 -3
  210. package/src/utils/test-runners.d.ts +2 -1
  211. package/src/utils/test-runners.d.ts.map +1 -1
  212. package/src/utils/test-runners.js +2 -1
  213. package/src/utils/version-utils.d.ts +2 -2
  214. package/src/utils/version-utils.d.ts.map +1 -1
  215. package/src/utils/version-utils.js +3 -2
  216. package/src/utils/versions.d.ts +7 -6
  217. package/src/utils/versions.d.ts.map +1 -1
  218. package/src/utils/versions.js +8 -7
  219. package/src/utils/zoneless.d.ts +3 -0
  220. package/src/utils/zoneless.d.ts.map +1 -0
  221. package/src/utils/zoneless.js +28 -0
  222. package/{mf/index.d.ts → types/nx-angular-mf.d.ts} +1 -1
  223. package/types/nx-angular-mf.d.ts.map +1 -0
  224. package/types/nx-angular.d.ts +3 -0
  225. package/types/nx-angular.d.ts.map +1 -0
  226. package/index.d.ts +0 -3
  227. package/index.d.ts.map +0 -1
  228. package/mf/index.d.ts.map +0 -1
  229. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +0 -28
  230. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts.map +0 -1
  231. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +0 -159
  232. package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts.map +0 -1
  233. package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/__main__ +0 -1
  234. package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/app/__rootModuleFileName__ +0 -14
  235. package/src/generators/setup-ssr/files/pre-v19/root/tsconfig.server.json__tpl__ +0 -15
  236. package/src/generators/setup-ssr/files/pre-v19/server/application-builder/__serverFileName__ +0 -57
  237. package/src/generators/setup-ssr/files/pre-v19/server/server-builder/__serverFileName__ +0 -72
  238. package/src/generators/setup-ssr/files/pre-v19/standalone-src/__main__ +0 -12
  239. package/src/generators/setup-ssr/files/pre-v19/standalone-src/app/app.config.server.ts__tpl__ +0 -11
  240. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts +0 -3
  241. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts.map +0 -1
  242. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +0 -122
  243. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts +0 -3
  244. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts.map +0 -1
  245. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +0 -34
  246. package/src/migrations/update-16-4-0/update-angular-cli.d.ts +0 -4
  247. package/src/migrations/update-16-4-0/update-angular-cli.d.ts.map +0 -1
  248. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts +0 -3
  249. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts.map +0 -1
  250. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +0 -34
  251. package/src/migrations/update-16-7-0/update-angular-cli.d.ts +0 -4
  252. package/src/migrations/update-16-7-0/update-angular-cli.d.ts.map +0 -1
  253. package/src/migrations/update-16-7-0/update-angular-cli.js +0 -14
  254. /package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.d.ts → stylesheet-processor.d.ts} +0 -0
@@ -1,72 +0,0 @@
1
- import 'zone.js/node';
2
-
3
- import { APP_BASE_HREF } from '@angular/common';
4
- import { CommonEngine } from '@angular/ssr';
5
- import * as express from 'express';
6
- import { existsSync } from 'node:fs';
7
- import { join } from 'node:path';
8
- import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './src/<%= main.slice(0, -3) %>';
9
-
10
- // The Express app is exported so that it can be used by serverless Functions.
11
- export function app(): express.Express {
12
- const server = express();
13
- const distFolder = join(process.cwd(), '<%= browserDistDirectory %>');
14
- const indexHtml = existsSync(join(distFolder, 'index.original.html'))
15
- ? join(distFolder, 'index.original.html')
16
- : join(distFolder, 'index.html');
17
-
18
- const commonEngine = new CommonEngine();
19
-
20
- server.set('view engine', 'html');
21
- server.set('views', distFolder);
22
-
23
- // Example Express Rest API endpoints
24
- // server.get('/api/**', (req, res) => { });
25
- // Serve static files from /browser
26
- server.get(
27
- '*.*',
28
- express.static(distFolder, {
29
- maxAge: '1y',
30
- })
31
- );
32
-
33
- // All regular routes use the Angular engine
34
- server.get('*', (req, res, next) => {
35
- const { protocol, originalUrl, baseUrl, headers } = req;
36
-
37
- commonEngine
38
- .render({
39
- bootstrap<% if (!standalone) { %>: <%= rootModuleClassName %><% } %>,
40
- documentFilePath: indexHtml,
41
- url: `${protocol}://${headers.host}${originalUrl}`,
42
- publicPath: distFolder,
43
- providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
44
- })
45
- .then((html) => res.send(html))
46
- .catch((err) => next(err));
47
- });
48
-
49
- return server;
50
- }
51
-
52
- function run(): void {
53
- const port = process.env['PORT'] || <%= serverPort %>;
54
-
55
- // Start up the Node server
56
- const server = app();
57
- server.listen(port, () => {
58
- console.log(`Node Express server listening on http://localhost:${port}`);
59
- });
60
- }
61
-
62
- // Webpack will replace 'require' with '__webpack_require__'
63
- // '__non_webpack_require__' is a proxy to Node 'require'
64
- // The below code is to ensure that the server is run only when not requiring the bundle.
65
- declare const __non_webpack_require__: NodeRequire;
66
- const mainModule = __non_webpack_require__.main;
67
- const moduleFilename = mainModule && mainModule.filename || '';
68
- if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
69
- run();
70
- }
71
-
72
- export default <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %>;
@@ -1,12 +0,0 @@
1
- import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
2
- import { AppComponent } from './app/app.component';
3
- import { config } from './app/app.config.server';
4
-
5
- <%_ if (useBootstrapContext) { _%>
6
- const bootstrap = (context: BootstrapContext) =>
7
- bootstrapApplication(AppComponent, config, context);
8
- <%_ } else { _%>
9
- const bootstrap = () => bootstrapApplication(AppComponent, config);
10
- <%_ } _%>
11
-
12
- export default bootstrap;
@@ -1,11 +0,0 @@
1
- import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2
- import { provideServerRendering } from '@angular/platform-server';
3
- import { appConfig } from './app.config';
4
-
5
- const serverConfig: ApplicationConfig = {
6
- providers: [
7
- provideServerRendering()
8
- ]
9
- };
10
-
11
- export const config = mergeApplicationConfig(appConfig, serverConfig);
@@ -1,3 +0,0 @@
1
- import type { Tree } from '@nx/devkit';
2
- export default function (tree: Tree): Promise<void>;
3
- //# sourceMappingURL=switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAyBjD,yBAA+B,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCxD"}
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const devkit_1 = require("@nx/devkit");
5
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
6
- const project_graph_1 = require("nx/src/config/project-graph");
7
- const nx_deps_cache_1 = require("nx/src/project-graph/nx-deps-cache");
8
- const version_utils_1 = require("../../generators/utils/version-utils");
9
- const file_change_recorder_1 = require("../../utils/file-change-recorder");
10
- const projects_1 = require("../utils/projects");
11
- let tsquery;
12
- const angularPluginTargetNames = ['npm:@nx/angular', 'npm:@nrwl/angular'];
13
- const dataPersistenceOperators = [
14
- 'fetch',
15
- 'navigation',
16
- 'optimisticUpdate',
17
- 'pessimisticUpdate',
18
- ];
19
- const newImportPath = '@ngrx/router-store/data-persistence';
20
- async function default_1(tree) {
21
- const projects = await (0, projects_1.getProjectsFilteredByDependencies)(angularPluginTargetNames);
22
- if (!projects.length) {
23
- return;
24
- }
25
- (0, ensure_typescript_1.ensureTypescript)();
26
- tsquery = require('@phenomnomnominal/tsquery').tsquery;
27
- const cachedFileMap = (0, nx_deps_cache_1.readFileMapCache)().fileMap.projectFileMap;
28
- const filesWithNxAngularImports = [];
29
- for (const graphNode of projects) {
30
- const files = filterFilesWithNxAngularDep(cachedFileMap[graphNode.name] || []);
31
- filesWithNxAngularImports.push(...files);
32
- }
33
- let isAnyFileUsingDataPersistence = false;
34
- for (const { file } of filesWithNxAngularImports) {
35
- const updated = replaceDataPersistenceInFile(tree, file);
36
- isAnyFileUsingDataPersistence ||= updated;
37
- }
38
- if (isAnyFileUsingDataPersistence) {
39
- addNgrxRouterStoreIfNotInstalled(tree);
40
- await (0, devkit_1.formatFiles)(tree);
41
- }
42
- }
43
- function replaceDataPersistenceInFile(tree, file) {
44
- const fileContents = tree.read(file, 'utf-8');
45
- const fileAst = tsquery.ast(fileContents);
46
- // "\\u002F" is the unicode code for "/", there's an issue with the query parser
47
- // that prevents using "/" directly in regex queries
48
- // https://github.com/estools/esquery/issues/68#issuecomment-415597670
49
- const NX_ANGULAR_IMPORT_SELECTOR = 'ImportDeclaration:has(StringLiteral[value=/@(nx|nrwl)\\u002Fangular$/])';
50
- const nxAngularImports = tsquery(fileAst, NX_ANGULAR_IMPORT_SELECTOR, { visitAllChildren: true });
51
- if (!nxAngularImports.length) {
52
- return false;
53
- }
54
- const recorder = new file_change_recorder_1.FileChangeRecorder(tree, file);
55
- const IMPORT_SPECIFIERS_SELECTOR = 'ImportClause NamedImports ImportSpecifier';
56
- for (const importDeclaration of nxAngularImports) {
57
- const importSpecifiers = tsquery(importDeclaration, IMPORT_SPECIFIERS_SELECTOR, { visitAllChildren: true });
58
- if (!importSpecifiers.length) {
59
- continue;
60
- }
61
- // no imported symbol is a data persistence operator, skip
62
- if (importSpecifiers.every((i) => !isOperatorImport(i))) {
63
- continue;
64
- }
65
- // all imported symbols are data persistence operators, change import path
66
- if (importSpecifiers.every((i) => isOperatorImport(i))) {
67
- const IMPORT_PATH_SELECTOR = `${NX_ANGULAR_IMPORT_SELECTOR} > StringLiteral`;
68
- const importPathNode = tsquery(importDeclaration, IMPORT_PATH_SELECTOR, {
69
- visitAllChildren: true,
70
- });
71
- recorder.replace(importPathNode[0], `'${newImportPath}'`);
72
- continue;
73
- }
74
- // mixed imports, split data persistence operators to a separate import
75
- const operatorImportSpecifiers = [];
76
- for (const importSpecifier of importSpecifiers) {
77
- if (isOperatorImport(importSpecifier)) {
78
- operatorImportSpecifiers.push(importSpecifier.getText());
79
- recorder.remove(importSpecifier.getStart(), importSpecifier.getEnd() +
80
- (hasTrailingComma(recorder.originalContent, importSpecifier)
81
- ? 1
82
- : 0));
83
- }
84
- }
85
- recorder.insertLeft(importDeclaration.getStart(), `import { ${operatorImportSpecifiers.join(', ')} } from '${newImportPath}';`);
86
- }
87
- if (recorder.hasChanged()) {
88
- recorder.applyChanges();
89
- return true;
90
- }
91
- return false;
92
- }
93
- function hasTrailingComma(content, node) {
94
- return content[node.getEnd()] === ',';
95
- }
96
- function isOperatorImport(importSpecifier) {
97
- return dataPersistenceOperators.includes(getOriginalIdentifierTextFromImportSpecifier(importSpecifier));
98
- }
99
- function getOriginalIdentifierTextFromImportSpecifier(importSpecifier) {
100
- const children = importSpecifier.getChildren();
101
- if (!children.length) {
102
- return importSpecifier.getText();
103
- }
104
- return children[0].getText();
105
- }
106
- function addNgrxRouterStoreIfNotInstalled(tree) {
107
- const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, 'package.json');
108
- if (dependencies?.['@ngrx/router-store'] ||
109
- devDependencies?.['@ngrx/router-store']) {
110
- return;
111
- }
112
- (0, devkit_1.addDependenciesToPackageJson)(tree, { '@ngrx/router-store': (0, version_utils_1.versions)(tree).ngrxVersion }, {});
113
- }
114
- function filterFilesWithNxAngularDep(files) {
115
- const filteredFiles = [];
116
- for (const file of files) {
117
- if (file.deps?.some((dep) => angularPluginTargetNames.includes((0, project_graph_1.fileDataDepTarget)(dep)))) {
118
- filteredFiles.push(file);
119
- }
120
- }
121
- return filteredFiles;
122
- }
@@ -1,3 +0,0 @@
1
- import type { Tree } from '@nx/devkit';
2
- export default function (tree: Tree): Promise<void>;
3
- //# sourceMappingURL=rename-angular-eslint-accesibility-rules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rename-angular-eslint-accesibility-rules.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,yBAA+B,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBxD"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const devkit_1 = require("@nx/devkit");
5
- // https://github.com/angular-eslint/angular-eslint/blob/24a4de54a8991c93924abf1dfb78b132a6269aef/packages/schematics/src/migrations/update-16-0-0/update-16-0-0.ts
6
- async function default_1(tree) {
7
- (0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
8
- if (!filePath.endsWith('.eslintrc.json')) {
9
- return;
10
- }
11
- (0, devkit_1.updateJson)(tree, filePath, (json) => {
12
- if (json.overrides) {
13
- for (const override of json.overrides) {
14
- modifyRules(override);
15
- }
16
- }
17
- modifyRules(json);
18
- return json;
19
- });
20
- });
21
- await (0, devkit_1.formatFiles)(tree);
22
- }
23
- function modifyRules(parent) {
24
- if (!parent.rules) {
25
- return;
26
- }
27
- for (const rule of Object.keys(parent.rules)) {
28
- if (rule.startsWith('@angular-eslint/template/accessibility-')) {
29
- const ruleConfig = parent.rules[rule];
30
- parent.rules[rule.replace('@angular-eslint/template/accessibility-', '@angular-eslint/template/')] = ruleConfig;
31
- delete parent.rules[rule];
32
- }
33
- }
34
- }
@@ -1,4 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare const angularCliVersion = "~16.1.0";
3
- export default function (tree: Tree): Promise<void>;
4
- //# sourceMappingURL=update-angular-cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-16-4-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function (tree: Tree): Promise<void>;
3
- //# sourceMappingURL=explicitly-set-projects-to-update-buildable-deps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"explicitly-set-projects-to-update-buildable-deps.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AASpB,yBAA+B,IAAI,EAAE,IAAI,iBAmCxC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const devkit_1 = require("@nx/devkit");
5
- const executors = new Set([
6
- '@nx/angular:ng-packagr-lite',
7
- '@nrwl/angular:ng-packagr-lite',
8
- '@nx/angular:package',
9
- '@nrwl/angular:package',
10
- ]);
11
- async function default_1(tree) {
12
- // use project graph to get the expanded target configurations
13
- const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
14
- for (const [projectName, { data: projectData }] of Object.entries(projectGraph.nodes)) {
15
- if (projectData.projectType !== 'library') {
16
- continue;
17
- }
18
- for (const [targetName, target] of Object.entries(projectData.targets || {})) {
19
- if (!executors.has(target.executor)) {
20
- continue;
21
- }
22
- if (!target.options ||
23
- target.options.updateBuildableProjectDepsInPackageJson === undefined) {
24
- // read the project configuration to write the explicit project configuration
25
- // and avoid writing the expanded target configuration
26
- const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
27
- project.targets[targetName].options ??= {};
28
- project.targets[targetName].options.updateBuildableProjectDepsInPackageJson = true;
29
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
30
- }
31
- }
32
- }
33
- await (0, devkit_1.formatFiles)(tree);
34
- }
@@ -1,4 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare const angularCliVersion = "~16.2.0";
3
- export default function (tree: Tree): Promise<void>;
4
- //# sourceMappingURL=update-angular-cli.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-16-7-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.angularCliVersion = void 0;
4
- exports.default = default_1;
5
- const devkit_1 = require("@nx/devkit");
6
- exports.angularCliVersion = '~16.2.0';
7
- async function default_1(tree) {
8
- const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
9
- const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
10
- if (hasAngularCli) {
11
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/cli': exports.angularCliVersion });
12
- await (0, devkit_1.formatFiles)(tree);
13
- }
14
- }