@nx/angular 22.3.0-canary.20251211-205daee → 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 (252) 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/unit-test/schema.d.ts +7 -0
  19. package/src/executors/unit-test/schema.json +320 -0
  20. package/src/executors/unit-test/unit-test.impl.d.ts +5 -0
  21. package/src/executors/unit-test/unit-test.impl.d.ts.map +1 -0
  22. package/src/executors/unit-test/unit-test.impl.js +111 -0
  23. package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts.map +1 -0
  24. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts.map +1 -1
  25. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +2 -6
  26. package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.js → stylesheet-processor.js} +2 -2
  27. package/src/generators/application/application.d.ts +1 -1
  28. package/src/generators/application/application.d.ts.map +1 -1
  29. package/src/generators/application/application.js +6 -1
  30. package/src/generators/application/files/base/tsconfig.app.json__tpl__ +2 -4
  31. package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
  32. package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__ +2 -2
  33. package/src/generators/application/files/ng-module/src/main.ts__tpl__ +1 -3
  34. package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
  35. package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
  36. package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
  37. package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
  38. package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
  39. package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
  40. package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +6 -0
  41. package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
  42. package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
  43. package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.ts__tpl__ +1 -2
  44. package/src/generators/application/lib/add-unit-test-runner.d.ts +1 -1
  45. package/src/generators/application/lib/add-unit-test-runner.d.ts.map +1 -1
  46. package/src/generators/application/lib/add-unit-test-runner.js +13 -2
  47. package/src/generators/application/lib/create-files.d.ts.map +1 -1
  48. package/src/generators/application/lib/create-files.js +1 -3
  49. package/src/generators/application/lib/create-project.js +12 -10
  50. package/src/generators/application/lib/enable-strict-type-checking.js +1 -1
  51. package/src/generators/application/lib/index.d.ts +2 -1
  52. package/src/generators/application/lib/index.d.ts.map +1 -1
  53. package/src/generators/application/lib/index.js +2 -1
  54. package/src/generators/application/lib/normalize-options.d.ts.map +1 -1
  55. package/src/generators/application/lib/normalize-options.js +12 -2
  56. package/src/generators/application/lib/update-tsconfig-files.d.ts.map +1 -1
  57. package/src/generators/application/lib/update-tsconfig-files.js +6 -17
  58. package/src/generators/application/lib/validate-options.d.ts +4 -0
  59. package/src/generators/application/lib/validate-options.d.ts.map +1 -0
  60. package/src/generators/application/lib/validate-options.js +26 -0
  61. package/src/generators/application/schema.d.ts +1 -0
  62. package/src/generators/application/schema.json +7 -4
  63. package/src/generators/component/component.d.ts.map +1 -1
  64. package/src/generators/component/component.js +4 -3
  65. package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
  66. package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
  67. package/src/generators/component-test/component-test.d.ts +3 -3
  68. package/src/generators/component-test/component-test.d.ts.map +1 -1
  69. package/src/generators/component-test/component-test.js +9 -0
  70. package/src/generators/component-test/schema.d.ts +1 -0
  71. package/src/generators/component-test/schema.json +6 -0
  72. package/src/generators/convert-to-rspack/convert-to-rspack.d.ts.map +1 -1
  73. package/src/generators/convert-to-rspack/convert-to-rspack.js +1 -4
  74. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
  75. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +80 -33
  76. package/src/generators/cypress-component-configuration/schema.d.ts +1 -0
  77. package/src/generators/cypress-component-configuration/schema.json +6 -0
  78. package/src/generators/directive/directive.d.ts.map +1 -1
  79. package/src/generators/directive/directive.js +0 -3
  80. package/src/generators/directive/files/__fileName__.ts__tpl__ +1 -1
  81. package/src/generators/federate-module/federate-module.d.ts +1 -1
  82. package/src/generators/federate-module/federate-module.d.ts.map +1 -1
  83. package/src/generators/federate-module/federate-module.js +8 -0
  84. package/src/generators/federate-module/lib/add-remote.js +1 -1
  85. package/src/generators/federate-module/schema.d.ts +2 -2
  86. package/src/generators/federate-module/schema.json +3 -4
  87. package/src/generators/host/files/common/src/main.server.ts__tmpl__ +8 -1
  88. package/src/generators/host/host.d.ts.map +1 -1
  89. package/src/generators/host/host.js +5 -1
  90. package/src/generators/host/lib/index.d.ts +1 -0
  91. package/src/generators/host/lib/index.d.ts.map +1 -1
  92. package/src/generators/host/lib/index.js +1 -0
  93. package/src/generators/host/lib/update-ssr-setup.d.ts.map +1 -1
  94. package/src/generators/host/lib/update-ssr-setup.js +6 -4
  95. package/src/generators/host/lib/validate-options.d.ts +4 -0
  96. package/src/generators/host/lib/validate-options.d.ts.map +1 -0
  97. package/src/generators/host/lib/validate-options.js +12 -0
  98. package/src/generators/host/schema.d.ts +2 -2
  99. package/src/generators/host/schema.json +5 -6
  100. package/src/generators/library/files/base/tsconfig.lib.json__tpl__ +3 -5
  101. package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
  102. package/src/generators/library/lib/normalize-options.js +10 -3
  103. package/src/generators/library/lib/update-tsconfig-files.d.ts.map +1 -1
  104. package/src/generators/library/lib/update-tsconfig-files.js +15 -6
  105. package/src/generators/library/lib/validate-options.d.ts +4 -0
  106. package/src/generators/library/lib/validate-options.d.ts.map +1 -0
  107. package/src/generators/library/lib/validate-options.js +27 -0
  108. package/src/generators/library/library.d.ts.map +1 -1
  109. package/src/generators/library/library.js +20 -13
  110. package/src/generators/library/schema.json +3 -4
  111. package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts +16 -0
  112. package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts.map +1 -0
  113. package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.js +161 -0
  114. package/src/generators/ng-add/migrators/builders/index.d.ts +1 -0
  115. package/src/generators/ng-add/migrators/builders/index.d.ts.map +1 -1
  116. package/src/generators/ng-add/migrators/builders/index.js +1 -0
  117. package/src/generators/ng-add/migrators/projects/app.migrator.d.ts.map +1 -1
  118. package/src/generators/ng-add/migrators/projects/app.migrator.js +1 -0
  119. package/src/generators/ng-add/migrators/projects/lib.migrator.d.ts.map +1 -1
  120. package/src/generators/ng-add/migrators/projects/lib.migrator.js +1 -0
  121. package/src/generators/pipe/files/__fileName__.ts__tpl__ +1 -1
  122. package/src/generators/pipe/pipe.d.ts.map +1 -1
  123. package/src/generators/pipe/pipe.js +0 -5
  124. package/src/generators/remote/files/common/src/main.server.ts__tmpl__ +8 -1
  125. package/src/generators/remote/lib/index.d.ts +1 -0
  126. package/src/generators/remote/lib/index.d.ts.map +1 -1
  127. package/src/generators/remote/lib/index.js +1 -0
  128. package/src/generators/remote/lib/update-ssr-setup.d.ts +2 -1
  129. package/src/generators/remote/lib/update-ssr-setup.d.ts.map +1 -1
  130. package/src/generators/remote/lib/update-ssr-setup.js +7 -7
  131. package/src/generators/remote/lib/validate-options.d.ts +4 -0
  132. package/src/generators/remote/lib/validate-options.d.ts.map +1 -0
  133. package/src/generators/remote/lib/validate-options.js +12 -0
  134. package/src/generators/remote/remote.d.ts.map +1 -1
  135. package/src/generators/remote/remote.js +6 -1
  136. package/src/generators/remote/schema.d.ts +2 -2
  137. package/src/generators/remote/schema.json +5 -6
  138. package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +1 -1
  139. package/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +2 -2
  140. package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +5 -6
  141. package/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +1 -2
  142. package/src/generators/setup-mf/lib/add-remote-entry.d.ts.map +1 -1
  143. package/src/generators/setup-mf/lib/add-remote-entry.js +0 -5
  144. package/src/generators/setup-mf/lib/update-host-app-routes.d.ts.map +1 -1
  145. package/src/generators/setup-mf/lib/update-host-app-routes.js +9 -6
  146. package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +2 -2
  147. package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +6 -0
  148. package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
  149. package/src/generators/setup-ssr/lib/add-hydration.js +2 -8
  150. package/src/generators/setup-ssr/lib/add-server-file.d.ts.map +1 -1
  151. package/src/generators/setup-ssr/lib/add-server-file.js +7 -7
  152. package/src/generators/setup-ssr/lib/generate-files.d.ts.map +1 -1
  153. package/src/generators/setup-ssr/lib/generate-files.js +2 -7
  154. package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts.map +1 -1
  155. package/src/generators/setup-ssr/lib/generate-server-ts-config.js +26 -12
  156. package/src/generators/setup-ssr/lib/normalize-options.d.ts.map +1 -1
  157. package/src/generators/setup-ssr/lib/normalize-options.js +1 -5
  158. package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
  159. package/src/generators/setup-ssr/lib/update-project-config.js +6 -17
  160. package/src/generators/setup-ssr/lib/validate-options.d.ts.map +1 -1
  161. package/src/generators/setup-ssr/lib/validate-options.js +9 -0
  162. package/src/generators/utils/add-jest.d.ts +2 -0
  163. package/src/generators/utils/add-jest.d.ts.map +1 -1
  164. package/src/generators/utils/add-jest.js +41 -11
  165. package/src/generators/utils/add-vitest.d.ts +11 -2
  166. package/src/generators/utils/add-vitest.d.ts.map +1 -1
  167. package/src/generators/utils/add-vitest.js +173 -6
  168. package/src/generators/utils/assert-mf-utils.d.ts +1 -1
  169. package/src/generators/utils/assert-mf-utils.d.ts.map +1 -1
  170. package/src/generators/utils/assert-mf-utils.js +1 -4
  171. package/src/generators/utils/ensure-angular-dependencies.d.ts +1 -1
  172. package/src/generators/utils/ensure-angular-dependencies.d.ts.map +1 -1
  173. package/src/generators/utils/ensure-angular-dependencies.js +6 -4
  174. package/src/generators/utils/storybook-ast/component-info.js +2 -10
  175. package/src/generators/utils/tsconfig-utils.d.ts +13 -0
  176. package/src/generators/utils/tsconfig-utils.d.ts.map +1 -0
  177. package/src/generators/utils/tsconfig-utils.js +29 -0
  178. package/src/generators/utils/version-utils.d.ts +13 -3
  179. package/src/generators/utils/version-utils.d.ts.map +1 -1
  180. package/src/generators/utils/version-utils.js +11 -18
  181. package/src/migrations/update-21-2-0/update-module-resolution.d.ts.map +1 -1
  182. package/src/migrations/update-21-2-0/update-module-resolution.js +17 -4
  183. package/src/migrations/update-22-3-0/update-angular-cli.d.ts +4 -0
  184. package/src/migrations/update-22-3-0/update-angular-cli.d.ts.map +1 -0
  185. package/src/migrations/{update-16-4-0 → update-22-3-0}/update-angular-cli.js +1 -1
  186. package/src/migrations/update-22-3-0/update-module-resolution.d.ts +3 -0
  187. package/src/migrations/update-22-3-0/update-module-resolution.d.ts.map +1 -0
  188. package/src/migrations/update-22-3-0/update-module-resolution.js +61 -0
  189. package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts +3 -0
  190. package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts.map +1 -0
  191. package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +111 -0
  192. package/src/migrations/update-22-3-0/update-typescript-lib.d.ts +3 -0
  193. package/src/migrations/update-22-3-0/update-typescript-lib.d.ts.map +1 -0
  194. package/src/migrations/update-22-3-0/update-typescript-lib.js +98 -0
  195. package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts +3 -0
  196. package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts.map +1 -0
  197. package/src/migrations/update-22-3-0/update-unit-test-runner-option.js +44 -0
  198. package/src/plugins/plugin.d.ts.map +1 -1
  199. package/src/plugins/plugin.js +40 -24
  200. package/src/utils/backward-compatible-versions.d.ts +7 -9
  201. package/src/utils/backward-compatible-versions.d.ts.map +1 -1
  202. package/src/utils/backward-compatible-versions.js +20 -14
  203. package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
  204. package/src/utils/nx-devkit/ast-utils.js +2 -13
  205. package/src/utils/targets.d.ts +6 -1
  206. package/src/utils/targets.d.ts.map +1 -1
  207. package/src/utils/targets.js +20 -3
  208. package/src/utils/test-runners.d.ts +2 -1
  209. package/src/utils/test-runners.d.ts.map +1 -1
  210. package/src/utils/test-runners.js +2 -1
  211. package/src/utils/version-utils.d.ts +2 -2
  212. package/src/utils/version-utils.d.ts.map +1 -1
  213. package/src/utils/version-utils.js +3 -2
  214. package/src/utils/versions.d.ts +7 -6
  215. package/src/utils/versions.d.ts.map +1 -1
  216. package/src/utils/versions.js +8 -7
  217. package/src/utils/zoneless.d.ts +3 -0
  218. package/src/utils/zoneless.d.ts.map +1 -0
  219. package/src/utils/zoneless.js +28 -0
  220. package/{mf/index.d.ts → types/nx-angular-mf.d.ts} +1 -1
  221. package/types/nx-angular-mf.d.ts.map +1 -0
  222. package/types/nx-angular.d.ts +3 -0
  223. package/types/nx-angular.d.ts.map +1 -0
  224. package/index.d.ts +0 -3
  225. package/index.d.ts.map +0 -1
  226. package/mf/index.d.ts.map +0 -1
  227. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +0 -28
  228. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts.map +0 -1
  229. package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +0 -159
  230. package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts.map +0 -1
  231. package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/__main__ +0 -1
  232. package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/app/__rootModuleFileName__ +0 -14
  233. package/src/generators/setup-ssr/files/pre-v19/root/tsconfig.server.json__tpl__ +0 -15
  234. package/src/generators/setup-ssr/files/pre-v19/server/application-builder/__serverFileName__ +0 -57
  235. package/src/generators/setup-ssr/files/pre-v19/server/server-builder/__serverFileName__ +0 -72
  236. package/src/generators/setup-ssr/files/pre-v19/standalone-src/__main__ +0 -12
  237. package/src/generators/setup-ssr/files/pre-v19/standalone-src/app/app.config.server.ts__tpl__ +0 -11
  238. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts +0 -3
  239. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts.map +0 -1
  240. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +0 -122
  241. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts +0 -3
  242. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts.map +0 -1
  243. package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +0 -34
  244. package/src/migrations/update-16-4-0/update-angular-cli.d.ts +0 -4
  245. package/src/migrations/update-16-4-0/update-angular-cli.d.ts.map +0 -1
  246. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts +0 -3
  247. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts.map +0 -1
  248. package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +0 -34
  249. package/src/migrations/update-16-7-0/update-angular-cli.d.ts +0 -4
  250. package/src/migrations/update-16-7-0/update-angular-cli.d.ts.map +0 -1
  251. package/src/migrations/update-16-7-0/update-angular-cli.js +0 -14
  252. /package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.d.ts → stylesheet-processor.d.ts} +0 -0
@@ -83,6 +83,13 @@
83
83
  "type": "string"
84
84
  }
85
85
  },
86
+ "define": {
87
+ "description": "Defines global identifiers that will be replaced with a specified constant value when found in any JavaScript or TypeScript code including libraries. The value will be used directly. String values must be put in quotes. Identifiers within Angular metadata such as Component Decorators will not be replaced. _Note: this is only supported in Angular versions >= 21.0.0 and it's only applicable for the Vite-based development server._",
88
+ "type": "object",
89
+ "additionalProperties": {
90
+ "type": "string"
91
+ }
92
+ },
86
93
  "servePath": {
87
94
  "type": "string",
88
95
  "description": "The pathname where the app will be served."
@@ -94,7 +101,7 @@
94
101
  },
95
102
  "hmr": {
96
103
  "type": "boolean",
97
- "description": "Enable hot module replacement. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`."
104
+ "description": "Enable hot module replacement."
98
105
  },
99
106
  "watch": {
100
107
  "type": "boolean",
@@ -112,7 +119,7 @@
112
119
  },
113
120
  "inspect": {
114
121
  "default": false,
115
- "description": "Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled. _Note: this is only supported in Angular versions >= 18.1.0_.",
122
+ "description": "Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled.",
116
123
  "oneOf": [
117
124
  {
118
125
  "type": "string",
@@ -56,7 +56,7 @@ async function* applicationExecutor(options, context) {
56
56
  ? await (0, esbuild_extensions_1.loadIndexHtmlTransformer)(indexHtmlTransformerPath, options.tsConfig)
57
57
  : undefined;
58
58
  const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
59
- builderName: 'application',
59
+ builderName: '@nx/angular:application',
60
60
  description: 'Build an application.',
61
61
  optionSchema: require('./schema.json'),
62
62
  }, context);
@@ -28,7 +28,7 @@
28
28
  {
29
29
  "const": false,
30
30
  "type": "boolean",
31
- "description": "Indicates that a server entry point is not provided. _Note: this is only supported in Angular versions >= 19.0.0_."
31
+ "description": "Indicates that a server entry point is not provided."
32
32
  }
33
33
  ]
34
34
  },
@@ -50,19 +50,21 @@
50
50
  "description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
51
51
  },
52
52
  "security": {
53
- "description": "Security features to protect against XSS and other common attacks. _Note: this is only supported in Angular versions >= 19.0.0_.",
53
+ "description": "Security features to protect against XSS and other common attacks",
54
54
  "type": "object",
55
55
  "additionalProperties": false,
56
56
  "properties": {
57
57
  "autoCsp": {
58
- "description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases. It defaults to `false`.",
58
+ "description": "Enables automatic generation of a hash-based Strict Content Security Policy (https://web.dev/articles/strict-csp#choose-hash) based on scripts in index.html. Will default to true once we are out of experimental/preview phases.",
59
+ "default": false,
59
60
  "oneOf": [
60
61
  {
61
62
  "type": "object",
62
63
  "properties": {
63
64
  "unsafeEval": {
64
65
  "type": "boolean",
65
- "description": "Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in the auto-CSP. Please only enable this if you are absolutely sure that you need to, as allowing calls to eval will weaken the XSS defenses provided by the auto-CSP. It default to `false`."
66
+ "description": "Include the `unsafe-eval` directive (https://web.dev/articles/strict-csp#remove-eval) in the auto-CSP. Please only enable this if you are absolutely sure that you need to, as allowing calls to eval will weaken the XSS defenses provided by the auto-CSP.",
67
+ "default": false
66
68
  }
67
69
  },
68
70
  "additionalProperties": false
@@ -164,7 +166,7 @@
164
166
  "default": []
165
167
  },
166
168
  "sass": {
167
- "description": "Options to pass to the sass preprocessor. _Note: this is only supported in Angular versions >= 19.0.0_.",
169
+ "description": "Options to pass to the sass preprocessor.",
168
170
  "type": "object",
169
171
  "properties": {
170
172
  "fatalDeprecations": {
@@ -557,7 +559,7 @@
557
559
  "default": []
558
560
  },
559
561
  "prerender": {
560
- "description": "Prerender (SSG) pages of your application during build time. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`.",
562
+ "description": "Prerender (SSG) pages of your application during build time.",
561
563
  "oneOf": [
562
564
  {
563
565
  "type": "boolean",
@@ -596,7 +598,7 @@
596
598
  "description": "The server entry-point that when executed will spawn the web server."
597
599
  },
598
600
  "experimentalPlatform": {
599
- "description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the feature may undergo changes in future versions. _Note: this is only supported in Angular versions >= 19.0.0_.",
601
+ "description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the feature may undergo changes in future versions.",
600
602
  "default": "node",
601
603
  "enum": ["node", "neutral"]
602
604
  }
@@ -607,11 +609,11 @@
607
609
  },
608
610
  "appShell": {
609
611
  "type": "boolean",
610
- "description": "Generates an application shell during build time. It defaults to `false` in Angular versions < 19.0.0. Otherwise, the value will be `undefined`."
612
+ "description": "Generates an application shell during build time."
611
613
  },
612
614
  "outputMode": {
613
615
  "type": "string",
614
- "description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR). _Note: this is only supported in Angular versions >= 19.0.0_.",
616
+ "description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR).",
615
617
  "enum": ["static", "server"]
616
618
  },
617
619
  "buildLibsFromSource": {
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/executors/application/utils/normalize-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,0BAA0B,GAClC,0BAA0B,CA2C5B"}
1
+ {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/executors/application/utils/normalize-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,0BAA0B,GAClC,0BAA0B,CAc5B"}
@@ -4,32 +4,6 @@ exports.normalizeOptions = normalizeOptions;
4
4
  const angular_version_utils_1 = require("../../utilities/angular-version-utils");
5
5
  function normalizeOptions(options) {
6
6
  const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
7
- /**
8
- * We can't set the default values for `security.autoCsp` and
9
- * `security.autoCsp.unsafeEval` in the schema because our current schema
10
- * parsing would (incorrectly?) default `security` to an object with the
11
- * `autoCsp` property set to `false`. This would be problematic because the
12
- * option is not supported in Angular versions < 19. So, we don't set those
13
- * defaults in the schema and we normalize them here correctly.
14
- */
15
- let security = options.security;
16
- if (angularMajorVersion >= 19) {
17
- if (typeof security === 'object') {
18
- if (security.autoCsp === undefined) {
19
- security.autoCsp = false;
20
- }
21
- else if (typeof security.autoCsp === 'object' &&
22
- security.autoCsp.unsafeEval === undefined) {
23
- security.autoCsp.unsafeEval = false;
24
- }
25
- }
26
- }
27
- let appShell = options.appShell;
28
- let prerender = options.prerender;
29
- if (angularMajorVersion < 19) {
30
- appShell ??= false;
31
- prerender ??= false;
32
- }
33
7
  let sourceMap = options.sourceMap;
34
8
  if (sourceMap &&
35
9
  typeof sourceMap === 'object' &&
@@ -37,5 +11,5 @@ function normalizeOptions(options) {
37
11
  angularMajorVersion < 20) {
38
12
  delete sourceMap.sourcesContent;
39
13
  }
40
- return { ...options, appShell, prerender, security, sourceMap };
14
+ return { ...options, sourceMap };
41
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validate-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/executors/application/utils/validate-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,eAAe,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI,CA0EzE"}
1
+ {"version":3,"file":"validate-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/executors/application/utils/validate-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,eAAe,CAAC,OAAO,EAAE,0BAA0B,GAAG,IAAI,CA0CzE"}
@@ -5,23 +5,6 @@ const semver_1 = require("semver");
5
5
  const angular_version_utils_1 = require("../../utilities/angular-version-utils");
6
6
  function validateOptions(options) {
7
7
  const { version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
8
- if ((0, semver_1.lt)(angularVersion, '19.0.0')) {
9
- if (options.outputMode) {
10
- throw new Error(`The "outputMode" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
11
- }
12
- if (options.stylePreprocessorOptions?.sass) {
13
- throw new Error(`The "stylePreprocessorOptions.sass" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
14
- }
15
- if (typeof options.ssr === 'object' && options.ssr?.experimentalPlatform) {
16
- throw new Error(`The "ssr.experimentalPlatform" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
17
- }
18
- if (options.security !== undefined) {
19
- throw new Error(`The "security" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
20
- }
21
- if (typeof options.server === 'boolean' && options.server === false) {
22
- throw new Error(`The "false" value for the "server" option requires Angular version 19.0.0 or greater. You are currently using version ${angularVersion}.`);
23
- }
24
- }
25
8
  if ((0, semver_1.lt)(angularVersion, '20.0.0')) {
26
9
  if (options.sourceMap &&
27
10
  typeof options.sourceMap === 'object' &&
@@ -16,7 +16,7 @@ async function* esbuildExecutor(options, context) {
16
16
  const plugins = await (0, esbuild_extensions_1.loadPlugins)(pluginPaths, options.tsConfig);
17
17
  const { buildEsbuildBrowser } = require('@angular-devkit/build-angular/src/builders/browser-esbuild');
18
18
  const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
19
- builderName: 'browser-esbuild',
19
+ builderName: '@nx/angular:browser-esbuild',
20
20
  description: 'Build a browser application',
21
21
  optionSchema: require('@angular-devkit/build-angular/src/builders/browser-esbuild/schema.json'),
22
22
  }, context);
@@ -51,7 +51,7 @@ async function* extractI18nExecutor(options, context) {
51
51
  '@nx/angular:browser-esbuild',
52
52
  ].includes(buildTarget.executor);
53
53
  const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
54
- builderName: 'extrct-i18n',
54
+ builderName: '@nx/angular:extract-i18n',
55
55
  description: 'Extracts i18n messages from source code.',
56
56
  optionSchema: require('./schema.json'),
57
57
  }, context);
@@ -0,0 +1,7 @@
1
+ import type { UnitTestBuilderOptions } from '@angular/build';
2
+ import type { PluginSpec } from '../utilities/esbuild-extensions';
3
+
4
+ export interface UnitTestExecutorOptions extends UnitTestBuilderOptions {
5
+ indexHtmlTransformer?: string;
6
+ plugins?: string[] | PluginSpec[];
7
+ }
@@ -0,0 +1,320 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Schema for Nx Unit Test Executor",
4
+ "description": "Run application unit tests. _Note: this is only supported in Angular versions >= 21.0.0_.",
5
+ "outputCapture": "direct-nodejs",
6
+ "type": "object",
7
+ "properties": {
8
+ "buildTarget": {
9
+ "type": "string",
10
+ "description": "Specifies the build target to use for the unit test build in the format `project:target[:configuration]`. This defaults to the `build` target of the current project with the `development` configuration. You can also pass a comma-separated list of configurations. Example: `project:target:production,staging`.",
11
+ "pattern": "^[^:\\s]*:[^:\\s]*(:[^\\s]+)?$"
12
+ },
13
+ "tsConfig": {
14
+ "type": "string",
15
+ "description": "The path to the TypeScript configuration file, relative to the workspace root. Defaults to `tsconfig.spec.json` in the project root if it exists. If not specified and the default does not exist, the `tsConfig` from the specified `buildTarget` will be used."
16
+ },
17
+ "runner": {
18
+ "type": "string",
19
+ "description": "Specifies the test runner to use for test execution.",
20
+ "default": "vitest",
21
+ "enum": ["karma", "vitest"]
22
+ },
23
+ "runnerConfig": {
24
+ "type": ["string", "boolean"],
25
+ "description": "Specifies the configuration file for the selected test runner. If a string is provided, it will be used as the path to the configuration file. If `true`, the builder will search for a default configuration file (e.g., `vitest.config.ts` or `karma.conf.js`). If `false`, no external configuration file will be used.\\nFor Vitest, this enables advanced options and the use of custom plugins. Please note that while the file is loaded, the Angular team does not provide direct support for its specific contents or any third-party plugins used within it.",
26
+ "default": false
27
+ },
28
+ "browsers": {
29
+ "description": "Specifies the browsers to use for test execution. When not specified, tests are run in a Node.js environment using jsdom. For both Vitest and Karma, browser names ending with 'Headless' (e.g., 'ChromeHeadless') will enable headless mode.",
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string"
33
+ },
34
+ "minItems": 1
35
+ },
36
+ "browserViewport": {
37
+ "description": "Specifies the browser viewport dimensions for browser-based tests in the format `widthxheight`.",
38
+ "type": "string",
39
+ "pattern": "^\\d+x\\d+$"
40
+ },
41
+ "include": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "string"
45
+ },
46
+ "default": ["**/*.spec.ts", "**/*.test.ts"],
47
+ "description": "Specifies glob patterns of files to include for testing, relative to the project root. This option also has special handling for directory paths (includes all test files within) and file paths (includes the corresponding test file if one exists)."
48
+ },
49
+ "exclude": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string"
53
+ },
54
+ "description": "Specifies glob patterns of files to exclude from testing, relative to the project root."
55
+ },
56
+ "filter": {
57
+ "type": "string",
58
+ "description": "Specifies a regular expression pattern to match against test suite and test names. Only tests with a name matching the pattern will be executed. For example, `^App` will run only tests in suites beginning with 'App'."
59
+ },
60
+ "watch": {
61
+ "type": "boolean",
62
+ "description": "Enables watch mode, which re-runs tests when source files change. Defaults to `true` in TTY environments and `false` otherwise."
63
+ },
64
+ "debug": {
65
+ "type": "boolean",
66
+ "description": "Enables debugging mode for tests, allowing the use of the Node Inspector.",
67
+ "default": false
68
+ },
69
+ "ui": {
70
+ "type": "boolean",
71
+ "description": "Enables the Vitest UI for interactive test execution. This option is only available for the Vitest runner.",
72
+ "default": false
73
+ },
74
+ "coverage": {
75
+ "type": "boolean",
76
+ "description": "Enables coverage reporting for tests.",
77
+ "default": false
78
+ },
79
+ "coverageInclude": {
80
+ "type": "array",
81
+ "description": "Specifies glob patterns of files to include in the coverage report.",
82
+ "items": {
83
+ "type": "string"
84
+ }
85
+ },
86
+ "coverageExclude": {
87
+ "type": "array",
88
+ "description": "Specifies glob patterns of files to exclude from the coverage report.",
89
+ "items": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "coverageReporters": {
94
+ "type": "array",
95
+ "description": "Specifies the reporters to use for coverage results. Each reporter can be a string representing its name, or a tuple containing the name and an options object. Built-in reporters include 'html', 'lcov', 'lcovonly', 'text', 'text-summary', 'cobertura', 'json', and 'json-summary'.",
96
+ "items": {
97
+ "oneOf": [
98
+ {
99
+ "enum": [
100
+ "html",
101
+ "lcov",
102
+ "lcovonly",
103
+ "text",
104
+ "text-summary",
105
+ "cobertura",
106
+ "json",
107
+ "json-summary"
108
+ ]
109
+ },
110
+ {
111
+ "type": "array",
112
+ "minItems": 1,
113
+ "maxItems": 2,
114
+ "items": [
115
+ {
116
+ "enum": [
117
+ "html",
118
+ "lcov",
119
+ "lcovonly",
120
+ "text",
121
+ "text-summary",
122
+ "cobertura",
123
+ "json",
124
+ "json-summary"
125
+ ]
126
+ },
127
+ {
128
+ "type": "object"
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ }
134
+ },
135
+ "coverageThresholds": {
136
+ "type": "object",
137
+ "description": "Specifies minimum coverage thresholds that must be met. If thresholds are not met, the builder will exit with an error.",
138
+ "properties": {
139
+ "perFile": {
140
+ "type": "boolean",
141
+ "description": "When true, thresholds are enforced for each file individually."
142
+ },
143
+ "statements": {
144
+ "type": "number",
145
+ "description": "Minimum percentage of statements covered."
146
+ },
147
+ "branches": {
148
+ "type": "number",
149
+ "description": "Minimum percentage of branches covered."
150
+ },
151
+ "functions": {
152
+ "type": "number",
153
+ "description": "Minimum percentage of functions covered."
154
+ },
155
+ "lines": {
156
+ "type": "number",
157
+ "description": "Minimum percentage of lines covered."
158
+ }
159
+ },
160
+ "additionalProperties": false
161
+ },
162
+ "coverageWatermarks": {
163
+ "type": "object",
164
+ "description": "Specifies coverage watermarks for the HTML reporter. These determine the color coding for high, medium, and low coverage.",
165
+ "properties": {
166
+ "statements": {
167
+ "type": "array",
168
+ "description": "The high and low watermarks for statements coverage. `[low, high]`",
169
+ "items": { "type": "number" },
170
+ "minItems": 2,
171
+ "maxItems": 2
172
+ },
173
+ "branches": {
174
+ "type": "array",
175
+ "description": "The high and low watermarks for branches coverage. `[low, high]`",
176
+ "items": { "type": "number" },
177
+ "minItems": 2,
178
+ "maxItems": 2
179
+ },
180
+ "functions": {
181
+ "type": "array",
182
+ "description": "The high and low watermarks for functions coverage. `[low, high]`",
183
+ "items": { "type": "number" },
184
+ "minItems": 2,
185
+ "maxItems": 2
186
+ },
187
+ "lines": {
188
+ "type": "array",
189
+ "description": "The high and low watermarks for lines coverage. `[low, high]`",
190
+ "items": { "type": "number" },
191
+ "minItems": 2,
192
+ "maxItems": 2
193
+ }
194
+ },
195
+ "additionalProperties": false
196
+ },
197
+ "reporters": {
198
+ "type": "array",
199
+ "description": "Specifies the reporters to use during test execution. Each reporter can be a string representing its name, or a tuple containing the name and an options object. Built-in reporters include 'default', 'verbose', 'dots', 'json', 'junit', 'tap', 'tap-flat', and 'html'. You can also provide a path to a custom reporter.",
200
+ "items": {
201
+ "oneOf": [
202
+ {
203
+ "anyOf": [
204
+ {
205
+ "type": "string"
206
+ },
207
+ {
208
+ "enum": [
209
+ "default",
210
+ "verbose",
211
+ "dots",
212
+ "json",
213
+ "junit",
214
+ "tap",
215
+ "tap-flat",
216
+ "html"
217
+ ]
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ "type": "array",
223
+ "minItems": 1,
224
+ "maxItems": 2,
225
+ "items": [
226
+ {
227
+ "anyOf": [
228
+ {
229
+ "type": "string"
230
+ },
231
+ {
232
+ "enum": [
233
+ "default",
234
+ "verbose",
235
+ "dots",
236
+ "json",
237
+ "junit",
238
+ "tap",
239
+ "tap-flat",
240
+ "html"
241
+ ]
242
+ }
243
+ ]
244
+ },
245
+ {
246
+ "type": "object"
247
+ }
248
+ ]
249
+ }
250
+ ]
251
+ }
252
+ },
253
+ "outputFile": {
254
+ "type": "string",
255
+ "description": "Specifies a file path for the test report, applying only to the first reporter. To configure output files for multiple reporters, use the tuple format `['reporter-name', { outputFile: '...' }]` within the `reporters` option. When not provided, output is written to the console."
256
+ },
257
+ "providersFile": {
258
+ "type": "string",
259
+ "description": "Specifies the path to a TypeScript file that provides an array of Angular providers for the test environment. The file must contain a default export of the provider array.",
260
+ "minLength": 1
261
+ },
262
+ "setupFiles": {
263
+ "type": "array",
264
+ "items": {
265
+ "type": "string"
266
+ },
267
+ "description": "A list of paths to global setup files that are executed before the test files. The application's polyfills and the Angular TestBed are always initialized before these files."
268
+ },
269
+ "progress": {
270
+ "type": "boolean",
271
+ "description": "Shows build progress information in the console. Defaults to the `progress` setting of the specified `buildTarget`."
272
+ },
273
+ "listTests": {
274
+ "type": "boolean",
275
+ "description": "Lists all discovered test files and exits the process without building or executing the tests.",
276
+ "default": false
277
+ },
278
+ "dumpVirtualFiles": {
279
+ "type": "boolean",
280
+ "description": "Dumps build output files to the `.angular/cache` directory for debugging purposes.",
281
+ "default": false,
282
+ "visible": false
283
+ },
284
+ "plugins": {
285
+ "description": "A list of ESBuild plugins.",
286
+ "type": "array",
287
+ "items": {
288
+ "oneOf": [
289
+ {
290
+ "type": "object",
291
+ "properties": {
292
+ "path": {
293
+ "type": "string",
294
+ "description": "The path to the plugin. Relative to the workspace root."
295
+ },
296
+ "options": {
297
+ "type": "object",
298
+ "description": "The options to provide to the plugin.",
299
+ "properties": {},
300
+ "additionalProperties": true
301
+ }
302
+ },
303
+ "additionalProperties": false,
304
+ "required": ["path"]
305
+ },
306
+ {
307
+ "type": "string",
308
+ "description": "The path to the plugin. Relative to the workspace root."
309
+ }
310
+ ]
311
+ }
312
+ },
313
+ "indexHtmlTransformer": {
314
+ "description": "Path to a file exposing a default function to transform the `index.html` file.",
315
+ "type": "string"
316
+ }
317
+ },
318
+ "additionalProperties": false,
319
+ "required": []
320
+ }
@@ -0,0 +1,5 @@
1
+ import type { BuilderOutput } from '@angular-devkit/architect';
2
+ import type { ExecutorContext } from '@nx/devkit';
3
+ import type { UnitTestExecutorOptions } from './schema';
4
+ export default function unitTestExecutor(options: UnitTestExecutorOptions, context: ExecutorContext): AsyncIterable<BuilderOutput>;
5
+ //# sourceMappingURL=unit-test.impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit-test.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/executors/unit-test/unit-test.impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAK/E,OAAO,KAAK,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAW1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAExD,wBAA+B,gBAAgB,CAC7C,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe,GACvB,aAAa,CAAC,aAAa,CAAC,CAyC9B"}