nx 17.0.2 → 17.0.4

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 (319) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +9 -4
  3. package/bin/init-local.js +10 -60
  4. package/bin/nx-cloud.js +6 -0
  5. package/bin/nx.js +1 -9
  6. package/bin/post-install.js +5 -1
  7. package/bin/run-executor.js +1 -1
  8. package/migrations.json +18 -0
  9. package/package.json +21 -18
  10. package/plugins/package-json.js +1 -1
  11. package/{changelog-renderer → release/changelog-renderer}/index.d.ts +18 -3
  12. package/{changelog-renderer → release/changelog-renderer}/index.js +78 -34
  13. package/release/index.d.ts +4 -0
  14. package/release/index.js +11 -0
  15. package/schemas/nx-schema.json +203 -19
  16. package/schemas/project-schema.json +20 -0
  17. package/src/adapter/angular-json.js +28 -18
  18. package/src/adapter/compat.d.ts +2 -2
  19. package/src/adapter/compat.js +6 -1
  20. package/src/adapter/ngcli-adapter.d.ts +16 -4
  21. package/src/adapter/ngcli-adapter.js +85 -28
  22. package/src/command-line/add/add.d.ts +2 -0
  23. package/src/command-line/add/add.js +169 -0
  24. package/src/command-line/add/command-object.d.ts +7 -0
  25. package/src/command-line/add/command-object.js +24 -0
  26. package/src/command-line/affected/affected.js +0 -3
  27. package/src/command-line/affected/command-object.d.ts +4 -4
  28. package/src/command-line/affected/command-object.js +53 -26
  29. package/src/command-line/affected/print-affected.js +10 -1
  30. package/src/command-line/connect/command-object.d.ts +1 -2
  31. package/src/command-line/connect/command-object.js +3 -7
  32. package/src/command-line/connect/connect-to-nx-cloud.d.ts +4 -5
  33. package/src/command-line/connect/connect-to-nx-cloud.js +43 -31
  34. package/src/command-line/connect/view-logs.js +5 -21
  35. package/src/command-line/examples.js +18 -0
  36. package/src/command-line/exec/command-object.js +2 -1
  37. package/src/command-line/exec/exec.d.ts +1 -1
  38. package/src/command-line/exec/exec.js +78 -35
  39. package/src/command-line/format/format.js +13 -4
  40. package/src/command-line/generate/generate.js +9 -9
  41. package/src/command-line/generate/generator-utils.d.ts +3 -2
  42. package/src/command-line/generate/generator-utils.js +5 -5
  43. package/src/command-line/graph/graph.d.ts +1 -1
  44. package/src/command-line/graph/graph.js +82 -37
  45. package/src/command-line/init/command-object.js +70 -43
  46. package/src/command-line/init/implementation/add-nx-to-monorepo.d.ts +4 -2
  47. package/src/command-line/init/implementation/add-nx-to-monorepo.js +12 -2
  48. package/src/command-line/init/implementation/add-nx-to-nest.d.ts +1 -1
  49. package/src/command-line/init/implementation/add-nx-to-nest.js +10 -6
  50. package/src/command-line/init/implementation/add-nx-to-npm-repo.d.ts +4 -2
  51. package/src/command-line/init/implementation/add-nx-to-npm-repo.js +15 -4
  52. package/src/command-line/init/implementation/angular/index.js +4 -1
  53. package/src/command-line/init/implementation/angular/legacy-angular-versions.js +10 -5
  54. package/src/command-line/init/implementation/angular/standalone-workspace.js +1 -1
  55. package/src/command-line/init/implementation/angular/types.d.ts +1 -1
  56. package/src/command-line/init/implementation/dot-nx/nxw.js +47 -16
  57. package/src/command-line/init/implementation/react/index.d.ts +1 -1
  58. package/src/command-line/init/implementation/react/index.js +4 -2
  59. package/src/command-line/init/implementation/react/rename-js-to-jsx.js +4 -2
  60. package/src/command-line/init/implementation/utils.d.ts +6 -5
  61. package/src/command-line/init/implementation/utils.js +59 -44
  62. package/src/command-line/init/{init.js → init-v1.js} +5 -13
  63. package/src/command-line/init/init-v2.d.ts +7 -0
  64. package/src/command-line/init/init-v2.js +201 -0
  65. package/src/command-line/list/list.js +6 -5
  66. package/src/command-line/migrate/command-object.js +19 -4
  67. package/src/command-line/migrate/migrate.js +21 -17
  68. package/src/command-line/new/new.js +1 -1
  69. package/src/command-line/nx-commands.js +4 -1
  70. package/src/command-line/release/changelog.d.ts +22 -1
  71. package/src/command-line/release/changelog.js +459 -257
  72. package/src/command-line/release/command-object.d.ts +29 -7
  73. package/src/command-line/release/command-object.js +120 -20
  74. package/src/command-line/release/config/config.d.ts +26 -21
  75. package/src/command-line/release/config/config.js +416 -59
  76. package/src/command-line/release/config/conventional-commits.d.ts +2 -0
  77. package/src/command-line/release/config/conventional-commits.js +98 -0
  78. package/src/command-line/release/config/filter-release-groups.d.ts +1 -2
  79. package/src/command-line/release/config/filter-release-groups.js +38 -1
  80. package/src/command-line/release/index.d.ts +16 -0
  81. package/src/command-line/release/index.js +23 -0
  82. package/src/command-line/release/publish.d.ts +7 -3
  83. package/src/command-line/release/publish.js +89 -37
  84. package/src/command-line/release/release.d.ts +4 -0
  85. package/src/command-line/release/release.js +176 -0
  86. package/src/command-line/release/utils/batch-projects-by-generator-config.d.ts +7 -0
  87. package/src/command-line/release/utils/batch-projects-by-generator-config.js +37 -0
  88. package/src/command-line/release/utils/exec-command.d.ts +1 -0
  89. package/src/command-line/release/utils/exec-command.js +34 -0
  90. package/src/command-line/release/utils/git.d.ts +34 -1
  91. package/src/command-line/release/utils/git.js +238 -34
  92. package/src/command-line/release/utils/github.d.ts +5 -5
  93. package/src/command-line/release/utils/github.js +155 -8
  94. package/src/command-line/release/utils/markdown.js +6 -1
  95. package/src/command-line/release/utils/print-changes.d.ts +1 -1
  96. package/src/command-line/release/utils/print-changes.js +3 -3
  97. package/src/command-line/release/utils/resolve-nx-json-error-message.js +4 -1
  98. package/src/command-line/release/utils/resolve-semver-specifier.d.ts +4 -0
  99. package/src/command-line/release/utils/resolve-semver-specifier.js +58 -0
  100. package/src/command-line/release/utils/semver.d.ts +8 -0
  101. package/src/command-line/release/utils/semver.js +30 -1
  102. package/src/command-line/release/utils/shared.d.ts +39 -0
  103. package/src/command-line/release/utils/shared.js +213 -0
  104. package/src/command-line/release/version.d.ts +37 -3
  105. package/src/command-line/release/version.js +312 -117
  106. package/src/command-line/repair/repair.js +13 -9
  107. package/src/command-line/report/report.js +2 -2
  108. package/src/command-line/run/command-object.d.ts +4 -0
  109. package/src/command-line/run/command-object.js +18 -2
  110. package/src/command-line/run/executor-utils.d.ts +2 -1
  111. package/src/command-line/run/executor-utils.js +4 -4
  112. package/src/command-line/run/run-one.js +3 -6
  113. package/src/command-line/run/run.js +34 -9
  114. package/src/command-line/run-many/command-object.js +4 -1
  115. package/src/command-line/run-many/run-many.js +0 -3
  116. package/src/command-line/show/command-object.d.ts +3 -0
  117. package/src/command-line/show/command-object.js +29 -2
  118. package/src/command-line/show/show.js +9 -0
  119. package/src/command-line/yargs-utils/shared-options.d.ts +4 -1
  120. package/src/command-line/yargs-utils/shared-options.js +23 -9
  121. package/src/commands-runner/command-graph.d.ts +13 -0
  122. package/src/commands-runner/command-graph.js +2 -0
  123. package/src/commands-runner/create-command-graph.d.ts +4 -0
  124. package/src/commands-runner/create-command-graph.js +44 -0
  125. package/src/commands-runner/get-command-projects.d.ts +3 -0
  126. package/src/commands-runner/get-command-projects.js +19 -0
  127. package/src/config/nx-json.d.ts +160 -25
  128. package/src/config/project-graph.d.ts +3 -3
  129. package/src/config/workspace-json-project-json.d.ts +11 -1
  130. package/src/config/workspaces.d.ts +1 -1
  131. package/src/config/workspaces.js +4 -6
  132. package/src/core/graph/3rdpartylicenses.txt +144 -74
  133. package/src/core/graph/environment.js +1 -1
  134. package/src/core/graph/index.html +4 -6
  135. package/src/core/graph/main.js +1 -1
  136. package/src/core/graph/runtime.js +1 -1
  137. package/src/core/graph/styles.css +3 -3
  138. package/src/core/graph/styles.js +1 -1
  139. package/src/daemon/client/client.d.ts +5 -1
  140. package/src/daemon/client/client.js +27 -8
  141. package/src/daemon/client/{socket-messenger.d.ts → daemon-socket-messenger.d.ts} +1 -1
  142. package/src/daemon/client/{socket-messenger.js → daemon-socket-messenger.js} +3 -3
  143. package/src/daemon/daemon-project-graph-error.d.ts +8 -0
  144. package/src/daemon/daemon-project-graph-error.js +13 -0
  145. package/src/daemon/server/handle-hash-tasks.js +12 -2
  146. package/src/daemon/server/handle-request-project-graph.js +1 -1
  147. package/src/daemon/server/project-graph-incremental-recomputation.d.ts +14 -13
  148. package/src/daemon/server/project-graph-incremental-recomputation.js +98 -33
  149. package/src/daemon/server/shutdown-utils.js +2 -4
  150. package/src/daemon/server/watcher.js +0 -3
  151. package/src/daemon/socket-utils.d.ts +2 -1
  152. package/src/daemon/socket-utils.js +15 -4
  153. package/src/daemon/tmp-dir.d.ts +1 -0
  154. package/src/daemon/tmp-dir.js +4 -4
  155. package/src/devkit-exports.d.ts +2 -2
  156. package/src/devkit-exports.js +3 -2
  157. package/src/devkit-internals.d.ts +3 -0
  158. package/src/devkit-internals.js +7 -1
  159. package/src/executors/noop/schema.json +1 -1
  160. package/src/executors/run-commands/run-commands.impl.d.ts +10 -2
  161. package/src/executors/run-commands/run-commands.impl.js +152 -48
  162. package/src/executors/run-commands/schema.json +11 -1
  163. package/src/executors/run-script/run-script.impl.js +43 -11
  164. package/src/executors/utils/convert-nx-executor.js +1 -1
  165. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +3 -1
  166. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +4 -2
  167. package/src/generators/testing-utils/create-tree-with-empty-workspace.js +0 -6
  168. package/src/generators/tree.d.ts +1 -0
  169. package/src/generators/utils/glob.js +2 -2
  170. package/src/generators/utils/project-configuration.js +37 -16
  171. package/src/hasher/create-task-hasher.d.ts +4 -0
  172. package/src/hasher/create-task-hasher.js +16 -0
  173. package/src/hasher/hash-task.js +9 -3
  174. package/src/hasher/native-task-hasher-impl.d.ts +19 -0
  175. package/src/hasher/native-task-hasher-impl.js +37 -0
  176. package/src/hasher/node-task-hasher-impl.d.ts +49 -0
  177. package/src/hasher/node-task-hasher-impl.js +431 -0
  178. package/src/hasher/task-hasher.d.ts +33 -21
  179. package/src/hasher/task-hasher.js +30 -428
  180. package/src/migrations/update-15-0-0/migrate-to-inputs.js +5 -5
  181. package/src/migrations/update-15-1-0/set-project-names.js +2 -1
  182. package/src/migrations/update-15-8-2/update-nxw.js +2 -6
  183. package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +3 -3
  184. package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +49 -13
  185. package/src/migrations/update-17-2-0/move-default-base.d.ts +5 -0
  186. package/src/migrations/update-17-2-0/move-default-base.js +21 -0
  187. package/src/migrations/update-17-3-0/nx-release-path.d.ts +3 -0
  188. package/src/migrations/update-17-3-0/nx-release-path.js +48 -0
  189. package/src/migrations/update-17-3-0/update-nxw.d.ts +2 -0
  190. package/src/migrations/update-17-3-0/update-nxw.js +7 -0
  191. package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +2 -0
  192. package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +9 -0
  193. package/src/native/index.d.ts +65 -15
  194. package/src/native/index.js +6 -2
  195. package/src/native/transform-objects.js +2 -0
  196. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.d.ts +1 -0
  197. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +13 -12
  198. package/src/nx-cloud/generators/connect-to-nx-cloud/schema.json +6 -1
  199. package/src/nx-cloud/update-manager.js +2 -1
  200. package/src/plugins/js/index.d.ts +1 -1
  201. package/src/plugins/js/index.js +3 -3
  202. package/src/plugins/js/lock-file/lock-file.d.ts +2 -2
  203. package/src/plugins/js/lock-file/lock-file.js +15 -3
  204. package/src/plugins/js/package-json/create-package-json.js +1 -1
  205. package/src/plugins/js/project-graph/build-dependencies/strip-source-code.d.ts +1 -1
  206. package/src/plugins/js/project-graph/build-dependencies/strip-source-code.js +1 -1
  207. package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.d.ts +1 -1
  208. package/src/plugins/js/project-graph/build-dependencies/typescript-import-locator.js +1 -1
  209. package/src/plugins/js/utils/register.d.ts +1 -1
  210. package/src/plugins/js/utils/register.js +28 -8
  211. package/src/plugins/js/versions.d.ts +1 -1
  212. package/src/plugins/js/versions.js +1 -1
  213. package/{plugins/package-json-workspaces.d.ts → src/plugins/package-json-workspaces/create-nodes.d.ts} +4 -4
  214. package/{plugins/package-json-workspaces.js → src/plugins/package-json-workspaces/create-nodes.js} +34 -12
  215. package/src/plugins/package-json-workspaces/index.d.ts +1 -0
  216. package/src/plugins/package-json-workspaces/index.js +4 -0
  217. package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.d.ts +2 -0
  218. package/src/plugins/project-json/build-nodes/package-json-next-to-project-json.js +47 -0
  219. package/src/plugins/project-json/build-nodes/project-json.d.ts +2 -5
  220. package/src/plugins/project-json/build-nodes/project-json.js +6 -44
  221. package/src/plugins/target-defaults/target-defaults-plugin.d.ts +66 -0
  222. package/src/plugins/target-defaults/target-defaults-plugin.js +182 -0
  223. package/src/project-graph/affected/locators/project-glob-changes.js +3 -3
  224. package/src/project-graph/affected/locators/workspace-projects.d.ts +0 -2
  225. package/src/project-graph/affected/locators/workspace-projects.js +16 -29
  226. package/src/project-graph/build-project-graph.d.ts +20 -1
  227. package/src/project-graph/build-project-graph.js +91 -33
  228. package/src/project-graph/file-map-utils.d.ts +9 -5
  229. package/src/project-graph/file-map-utils.js +16 -63
  230. package/src/project-graph/file-utils.d.ts +1 -1
  231. package/src/project-graph/file-utils.js +44 -2
  232. package/src/project-graph/nx-deps-cache.js +1 -1
  233. package/src/project-graph/project-graph-builder.d.ts +1 -1
  234. package/src/project-graph/project-graph-builder.js +1 -1
  235. package/src/project-graph/project-graph.d.ts +32 -1
  236. package/src/project-graph/project-graph.js +147 -23
  237. package/src/project-graph/utils/build-all-workspace-files.d.ts +2 -0
  238. package/src/project-graph/utils/build-all-workspace-files.js +15 -0
  239. package/src/project-graph/utils/normalize-project-nodes.d.ts +2 -3
  240. package/src/project-graph/utils/normalize-project-nodes.js +11 -34
  241. package/src/project-graph/utils/project-configuration-utils.d.ts +66 -4
  242. package/src/project-graph/utils/project-configuration-utils.js +503 -62
  243. package/src/project-graph/utils/retrieve-workspace-files.d.ts +12 -31
  244. package/src/project-graph/utils/retrieve-workspace-files.js +27 -88
  245. package/src/tasks-runner/batch/run-batch.js +3 -3
  246. package/src/tasks-runner/cache.js +6 -3
  247. package/src/tasks-runner/create-task-graph.js +1 -1
  248. package/src/tasks-runner/fork.d.ts +1 -0
  249. package/src/tasks-runner/fork.js +23 -0
  250. package/src/tasks-runner/forked-process-task-runner.d.ts +13 -5
  251. package/src/tasks-runner/forked-process-task-runner.js +111 -21
  252. package/src/tasks-runner/init-tasks-runner.js +1 -1
  253. package/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +28 -28
  254. package/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +19 -22
  255. package/src/tasks-runner/life-cycles/empty-terminal-output-life-cycle.js +1 -3
  256. package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +1 -3
  257. package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +2 -4
  258. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +1 -0
  259. package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +11 -5
  260. package/src/tasks-runner/life-cycles/view-logs-utils.js +1 -1
  261. package/src/tasks-runner/pseudo-ipc.d.ts +49 -0
  262. package/src/tasks-runner/pseudo-ipc.js +140 -0
  263. package/src/tasks-runner/pseudo-terminal.d.ts +43 -0
  264. package/src/tasks-runner/pseudo-terminal.js +159 -0
  265. package/src/tasks-runner/run-command.d.ts +1 -1
  266. package/src/tasks-runner/run-command.js +13 -19
  267. package/src/tasks-runner/task-env.js +1 -2
  268. package/src/tasks-runner/task-graph-utils.d.ts +7 -3
  269. package/src/tasks-runner/task-graph-utils.js +15 -15
  270. package/src/tasks-runner/task-orchestrator.js +66 -12
  271. package/src/tasks-runner/tasks-schedule.js +3 -3
  272. package/src/tasks-runner/utils.d.ts +16 -7
  273. package/src/tasks-runner/utils.js +30 -16
  274. package/src/utils/ab-testing.d.ts +36 -2
  275. package/src/utils/ab-testing.js +34 -16
  276. package/src/utils/assert-workspace-validity.js +1 -1
  277. package/src/utils/cache-directory.d.ts +1 -0
  278. package/src/utils/cache-directory.js +5 -1
  279. package/src/utils/child-process.d.ts +15 -1
  280. package/src/utils/child-process.js +91 -1
  281. package/src/utils/command-line-utils.js +2 -1
  282. package/src/utils/exit-codes.d.ts +6 -0
  283. package/src/utils/exit-codes.js +20 -0
  284. package/src/utils/fileutils.d.ts +1 -0
  285. package/src/utils/find-matching-projects.js +5 -5
  286. package/src/utils/find-workspace-root.js +1 -0
  287. package/src/utils/ignore.js +8 -1
  288. package/src/utils/json-diff.d.ts +1 -0
  289. package/src/utils/json-diff.js +2 -1
  290. package/src/utils/json.js +3 -1
  291. package/src/utils/logger.js +1 -1
  292. package/src/utils/nx-cloud-utils.d.ts +1 -1
  293. package/src/utils/nx-cloud-utils.js +9 -4
  294. package/src/utils/nx-plugin.d.ts +32 -15
  295. package/src/utils/nx-plugin.deprecated.d.ts +10 -5
  296. package/src/utils/nx-plugin.deprecated.js +23 -0
  297. package/src/utils/nx-plugin.js +71 -80
  298. package/src/utils/output.d.ts +4 -2
  299. package/src/utils/output.js +44 -9
  300. package/src/utils/package-json.d.ts +4 -4
  301. package/src/utils/package-json.js +18 -12
  302. package/src/utils/package-manager.d.ts +8 -0
  303. package/src/utils/package-manager.js +29 -6
  304. package/src/utils/params.d.ts +12 -4
  305. package/src/utils/params.js +56 -8
  306. package/src/utils/plugins/core-plugins.js +8 -0
  307. package/src/utils/plugins/installed-plugins.d.ts +2 -1
  308. package/src/utils/plugins/installed-plugins.js +2 -2
  309. package/src/utils/plugins/local-plugins.js +1 -1
  310. package/src/utils/plugins/plugin-capabilities.d.ts +3 -2
  311. package/src/utils/plugins/plugin-capabilities.js +7 -7
  312. package/src/utils/typescript.js +1 -1
  313. package/src/utils/update-nxw.d.ts +2 -0
  314. package/src/utils/update-nxw.js +12 -0
  315. package/src/utils/workspace-configuration-check.js +1 -1
  316. package/src/utils/workspace-context.d.ts +6 -4
  317. package/src/utils/workspace-context.js +19 -9
  318. package/src/core/graph/polyfills.js +0 -1
  319. /package/src/command-line/init/{init.d.ts → init-v1.d.ts} +0 -0
@@ -18,7 +18,12 @@
18
18
  "description": "Default based branch used by affected commands."
19
19
  }
20
20
  },
21
- "additionalProperties": false
21
+ "additionalProperties": false,
22
+ "deprecated": "Use `defaultBase` instead. Support for setting `defaultBase` in `affected` will be removed in Nx 19."
23
+ },
24
+ "defaultBase": {
25
+ "type": "string",
26
+ "description": "Default --base used by affected logic."
22
27
  },
23
28
  "tasksRunnerOptions": {
24
29
  "type": "object",
@@ -96,32 +101,76 @@
96
101
  "type": "boolean",
97
102
  "description": "Specifies whether the daemon should be used for the default tasks runner."
98
103
  },
104
+ "useInferencePlugins": {
105
+ "type": "boolean",
106
+ "description": "Specifies whether to add inference plugins when generating new projects."
107
+ },
99
108
  "release": {
100
109
  "type": "object",
101
110
  "description": "Configuration for the nx release commands.",
102
111
  "additionalProperties": false,
103
112
  "properties": {
113
+ "projects": {
114
+ "oneOf": [
115
+ {
116
+ "type": "string",
117
+ "description": "A project name"
118
+ },
119
+ {
120
+ "type": "array",
121
+ "description": "An array of project names",
122
+ "minItems": 1,
123
+ "items": {
124
+ "type": "string"
125
+ }
126
+ }
127
+ ]
128
+ },
104
129
  "groups": {
105
130
  "type": "object",
106
131
  "additionalProperties": {
107
132
  "type": "object",
108
133
  "properties": {
134
+ "projectsRelationship": {
135
+ "type": "string",
136
+ "enum": ["fixed", "independent"]
137
+ },
109
138
  "projects": {
110
139
  "oneOf": [
140
+ {
141
+ "type": "string",
142
+ "description": "A project name"
143
+ },
111
144
  {
112
145
  "type": "array",
146
+ "description": "An array of project names",
147
+ "minItems": 1,
113
148
  "items": {
114
149
  "type": "string"
115
- },
116
- "minItems": 1
117
- },
118
- {
119
- "type": "string"
150
+ }
120
151
  }
121
152
  ]
122
153
  },
123
154
  "version": {
124
- "$ref": "#/definitions/NxReleaseVersionConfiguration"
155
+ "allOf": [
156
+ {
157
+ "$ref": "#/definitions/NxReleaseVersionConfiguration"
158
+ },
159
+ {
160
+ "allOf": [
161
+ {
162
+ "not": {
163
+ "required": ["git"]
164
+ }
165
+ },
166
+ {
167
+ "not": {
168
+ "required": ["preVersionCommand"]
169
+ }
170
+ }
171
+ ]
172
+ }
173
+ ]
125
174
  },
126
175
  "changelog": {
127
176
  "oneOf": [
@@ -129,8 +178,7 @@
129
178
  "$ref": "#/definitions/NxReleaseChangelogConfiguration"
130
179
  },
131
180
  {
132
- "type": "boolean",
133
- "enum": [false]
181
+ "type": "boolean"
134
182
  }
135
183
  ]
136
184
  },
@@ -150,8 +198,7 @@
150
198
  "$ref": "#/definitions/NxReleaseChangelogConfiguration"
151
199
  },
152
200
  {
153
- "type": "boolean",
154
- "enum": [false]
201
+ "type": "boolean"
155
202
  }
156
203
  ]
157
204
  },
@@ -161,13 +208,29 @@
161
208
  "$ref": "#/definitions/NxReleaseChangelogConfiguration"
162
209
  },
163
210
  {
164
- "type": "boolean",
165
- "enum": [false]
211
+ "type": "boolean"
166
212
  }
167
213
  ]
214
+ },
215
+ "automaticFromRef": {
216
+ "type": "boolean",
217
+ "description": "Whether or not to automatically look up the first commit for the workspace (or package, if versioning independently) and use that as the starting point for changelog generation. If this is not enabled, changelog generation will fail if there is no previous matching git tag to use as a starting point."
218
+ },
219
+ "git": {
220
+ "$ref": "#/definitions/NxReleaseGitConfiguration"
168
221
  }
169
222
  }
170
223
  },
224
+ "conventionalCommits": {
225
+ "$ref": "#/definitions/NxReleaseConventionalCommitsConfiguration"
226
+ },
227
+ "projectsRelationship": {
228
+ "type": "string",
229
+ "enum": ["fixed", "independent"]
230
+ },
231
+ "git": {
232
+ "$ref": "#/definitions/NxReleaseGitConfiguration"
233
+ },
171
234
  "version": {
172
235
  "$ref": "#/definitions/NxReleaseVersionConfiguration"
173
236
  },
@@ -207,7 +270,9 @@
207
270
  {
208
271
  "type": "array",
209
272
  "description": "The projects that the targets belong to.",
210
- "items": { "type": "string" }
273
+ "items": {
274
+ "type": "string"
275
+ }
211
276
  }
212
277
  ]
213
278
  },
@@ -231,8 +296,12 @@
231
296
  "required": ["input"],
232
297
  "not": {
233
298
  "anyOf": [
234
- { "required": ["projects"] },
235
- { "required": ["dependencies"] }
299
+ {
300
+ "required": ["projects"]
301
+ },
302
+ {
303
+ "required": ["dependencies"]
304
+ }
236
305
  ]
237
306
  }
238
307
  }
@@ -264,7 +333,9 @@
264
333
  "properties": {
265
334
  "externalDependencies": {
266
335
  "type": "array",
267
- "items": { "type": "string" },
336
+ "items": {
337
+ "type": "string"
338
+ },
268
339
  "description": "The list of external dependencies that our target depends on for `nx:run-commands` and community plugins."
269
340
  }
270
341
  },
@@ -400,6 +471,7 @@
400
471
  {
401
472
  "type": "array",
402
473
  "description": "An array of project names",
474
+ "minItems": 1,
403
475
  "items": {
404
476
  "type": "string"
405
477
  }
@@ -431,8 +503,12 @@
431
503
  "required": ["target"],
432
504
  "not": {
433
505
  "anyOf": [
434
- { "required": ["projects"] },
435
- { "required": ["dependencies"] }
506
+ {
507
+ "required": ["projects"]
508
+ },
509
+ {
510
+ "required": ["dependencies"]
511
+ }
436
512
  ]
437
513
  }
438
514
  }
@@ -465,20 +541,79 @@
465
541
  "options": {
466
542
  "type": "object",
467
543
  "description": "The options passed to the plugin when creating nodes and dependencies"
544
+ },
545
+ "include": {
546
+ "type": "array",
547
+ "description": "File patterns which are included by the plugin",
548
+ "items": {
549
+ "type": "string"
550
+ }
551
+ },
552
+ "exclude": {
553
+ "type": "array",
554
+ "description": "File patterns which are excluded by the plugin",
555
+ "items": {
556
+ "type": "string"
557
+ }
468
558
  }
469
559
  }
470
560
  }
471
561
  ]
472
562
  },
563
+ "NxReleaseGitConfiguration": {
564
+ "type": "object",
565
+ "properties": {
566
+ "commit": {
567
+ "type": "boolean",
568
+ "description": "Whether or not to automatically commit the changes made by current command"
569
+ },
570
+ "commitMessage": {
571
+ "type": "string",
572
+ "description": "Custom git commit message to use when committing the changes made by this command"
573
+ },
574
+ "commitArgs": {
575
+ "type": "string",
576
+ "description": "Additional arguments (added after the --message argument, which may or may not be customized with --git-commit-message) to pass to the `git commit` command invoked behind the scenes"
577
+ },
578
+ "stageChanges": {
579
+ "type": "boolean",
580
+ "description": "Whether or not to stage the changes made by this command. Always treated as true if commit is true."
581
+ },
582
+ "tag": {
583
+ "type": "boolean",
584
+ "description": "Whether or not to automatically tag the changes made by this command"
585
+ },
586
+ "tagMessage": {
587
+ "type": "string",
588
+ "description": "Custom git tag message to use when tagging the changes made by this command. This defaults to be the same value as the tag itself."
589
+ },
590
+ "tagArgs": {
591
+ "type": "string",
592
+ "description": "Additional arguments to pass to the `git tag` command invoked behind the scenes"
593
+ }
594
+ }
595
+ },
473
596
  "NxReleaseVersionConfiguration": {
474
597
  "type": "object",
475
598
  "properties": {
599
+ "conventionalCommits": {
600
+ "type": "boolean",
601
+ "description": "Shorthand for enabling the current version of projects to be resolved from git tags, and the next version to be determined by analyzing commit messages according to the Conventional Commits specification.",
602
+ "default": false
603
+ },
476
604
  "generator": {
477
605
  "type": "string"
478
606
  },
479
607
  "generatorOptions": {
480
608
  "type": "object",
481
609
  "additionalProperties": true
610
+ },
611
+ "git": {
612
+ "$ref": "#/definitions/NxReleaseGitConfiguration"
613
+ },
614
+ "preVersionCommand": {
615
+ "type": "string",
616
+ "description": "A command to run after validation of nx release configuration, but before versioning begins. Used for preparing build artifacts. If --dry-run is passed, the command is still executed, but with the NX_DRY_RUN environment variable set to 'true'."
482
617
  }
483
618
  }
484
619
  },
@@ -530,6 +665,55 @@
530
665
  "ChangelogRenderOptions": {
531
666
  "type": "object",
532
667
  "additionalProperties": true
668
+ },
669
+ "NxReleaseConventionalCommitsConfiguration": {
670
+ "type": "object",
671
+ "properties": {
672
+ "types": {
673
+ "type": "object",
674
+ "description": "A map of commit types to their configuration. If a type is set to 'true', then it will be enabled with the default 'semverBump' of 'patch' and will appear in the changelog. If a type is set to 'false', then it will not trigger a version bump and will be hidden from the changelog.",
675
+ "additionalProperties": {
676
+ "oneOf": [
677
+ {
678
+ "type": "boolean"
679
+ },
680
+ {
681
+ "type": "object",
682
+ "properties": {
683
+ "semverBump": {
684
+ "type": "string",
685
+ "enum": ["major", "minor", "patch", "none"],
686
+ "description": "The semver bump to apply to the version of the project(s) when a commit of this type is included in the release.",
687
+ "default": "patch"
688
+ },
689
+ "changelog": {
690
+ "description": "Configuration for the changelog section for commits of this type. If set to 'true', then commits of this type will be included in the changelog with their default title for the type. If set to 'false', then commits of this type will not be included in the changelog.",
691
+ "oneOf": [
692
+ {
693
+ "type": "boolean"
694
+ },
695
+ {
696
+ "type": "object",
697
+ "properties": {
698
+ "title": {
699
+ "type": "string",
700
+ "description": "The title of the section in the changelog for commits of this type"
701
+ },
702
+ "hidden": {
703
+ "type": "boolean",
704
+ "description": "Whether or not to include commits of this type in the changelog",
705
+ "default": false
706
+ }
707
+ }
708
+ }
709
+ ]
710
+ }
711
+ }
712
+ }
713
+ ]
714
+ }
715
+ }
716
+ }
533
717
  }
534
718
  }
535
719
  }
@@ -127,6 +127,26 @@
127
127
  "items": {
128
128
  "type": "string"
129
129
  }
130
+ },
131
+ "release": {
132
+ "type": "object",
133
+ "description": "Configuration for the nx release commands.",
134
+ "properties": {
135
+ "version": {
136
+ "type": "object",
137
+ "description": "Configuration for the nx release version command.",
138
+ "properties": {
139
+ "generator": {
140
+ "type": "string",
141
+ "description": "The version generator to use. Defaults to @nx/js:release-version."
142
+ },
143
+ "generatorOptions": {
144
+ "type": "object",
145
+ "description": "Options for the version generator."
146
+ }
147
+ }
148
+ }
149
+ }
130
150
  }
131
151
  },
132
152
  "definitions": {
@@ -49,19 +49,26 @@ function readAngularJson(angularCliWorkspaceRoot) {
49
49
  return toNewFormat((0, fileutils_1.readJsonFile)(path.join(angularCliWorkspaceRoot, 'angular.json'))).projects;
50
50
  }
51
51
  function toNewFormat(w) {
52
- Object.values(w.projects || {}).forEach((projectConfig) => {
52
+ if (!w.projects) {
53
+ return w;
54
+ }
55
+ for (const name in w.projects ?? {}) {
56
+ const projectConfig = w.projects[name];
53
57
  if (projectConfig.architect) {
54
58
  renamePropertyWithStableKeys(projectConfig, 'architect', 'targets');
55
59
  }
56
60
  if (projectConfig.schematics) {
57
61
  renamePropertyWithStableKeys(projectConfig, 'schematics', 'generators');
58
62
  }
63
+ if (!projectConfig.name) {
64
+ projectConfig.name = name;
65
+ }
59
66
  Object.values(projectConfig.targets || {}).forEach((target) => {
60
67
  if (target.builder !== undefined) {
61
68
  renamePropertyWithStableKeys(target, 'builder', 'executor');
62
69
  }
63
70
  });
64
- });
71
+ }
65
72
  if (w.schematics) {
66
73
  renamePropertyWithStableKeys(w, 'schematics', 'generators');
67
74
  }
@@ -72,23 +79,26 @@ function toNewFormat(w) {
72
79
  }
73
80
  exports.toNewFormat = toNewFormat;
74
81
  function toOldFormat(w) {
75
- Object.values(w.projects || {}).forEach((projectConfig) => {
76
- if (typeof projectConfig === 'string') {
77
- throw new Error("'project.json' files are incompatible with version 1 workspace schemas.");
78
- }
79
- if (projectConfig.targets) {
80
- renamePropertyWithStableKeys(projectConfig, 'targets', 'architect');
81
- }
82
- if (projectConfig.generators) {
83
- renamePropertyWithStableKeys(projectConfig, 'generators', 'schematics');
84
- }
85
- delete projectConfig.name;
86
- Object.values(projectConfig.architect || {}).forEach((target) => {
87
- if (target.executor !== undefined) {
88
- renamePropertyWithStableKeys(target, 'executor', 'builder');
82
+ if (w.projects) {
83
+ for (const name in w.projects) {
84
+ const projectConfig = w.projects[name];
85
+ if (typeof projectConfig === 'string') {
86
+ throw new Error("'project.json' files are incompatible with version 1 workspace schemas.");
89
87
  }
90
- });
91
- });
88
+ if (projectConfig.targets) {
89
+ renamePropertyWithStableKeys(projectConfig, 'targets', 'architect');
90
+ }
91
+ if (projectConfig.generators) {
92
+ renamePropertyWithStableKeys(projectConfig, 'generators', 'schematics');
93
+ }
94
+ delete projectConfig.name;
95
+ Object.values(projectConfig.architect || {}).forEach((target) => {
96
+ if (target.executor !== undefined) {
97
+ renamePropertyWithStableKeys(target, 'executor', 'builder');
98
+ }
99
+ });
100
+ }
101
+ }
92
102
  if (w.generators) {
93
103
  renamePropertyWithStableKeys(w, 'generators', 'schematics');
94
104
  }
@@ -1,2 +1,2 @@
1
- export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType"];
2
- export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess"];
1
+ export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts", "metadata"];
2
+ export declare const allowedWorkspaceExtensions: readonly ["implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins"];
@@ -26,6 +26,9 @@ exports.allowedProjectExtensions = [
26
26
  'root',
27
27
  'sourceRoot',
28
28
  'projectType',
29
+ 'release',
30
+ 'includedScripts',
31
+ 'metadata',
29
32
  ];
30
33
  // If we pass props on the workspace that angular doesn't know about,
31
34
  // it throws a warning that users see. We want to pass them still,
@@ -36,6 +39,7 @@ exports.allowedProjectExtensions = [
36
39
  exports.allowedWorkspaceExtensions = [
37
40
  'implicitDependencies',
38
41
  'affected',
42
+ 'defaultBase',
39
43
  'tasksRunnerOptions',
40
44
  'workspaceLayout',
41
45
  'plugins',
@@ -55,6 +59,7 @@ exports.allowedWorkspaceExtensions = [
55
59
  'parallel',
56
60
  'cacheDirectory',
57
61
  'useDaemonProcess',
62
+ 'useInferencePlugins',
58
63
  ];
59
64
  if (!patched) {
60
65
  Module.prototype.require = function () {
@@ -119,7 +124,7 @@ function mockReadJsonWorkspace(readJsonUtils) {
119
124
  // readJsonWorkspace actually has AST parsing + more, so we
120
125
  // still need to call it rather than just return our file
121
126
  return originalReadJsonWorkspace.apply(this, [
122
- 'angular.json',
127
+ 'angular.json', // path name, doesn't matter
123
128
  {
124
129
  // second arg is a host, only method used is readFile
125
130
  readFile: () => JSON.stringify(workspaceConfiguration),
@@ -15,6 +15,7 @@ export declare function scheduleTarget(root: string, opts: {
15
15
  target: string;
16
16
  configuration: string;
17
17
  runOptions: any;
18
+ projects: Record<string, ProjectConfiguration>;
18
19
  }, verbose: boolean): Promise<Observable<import('@angular-devkit/architect').BuilderOutput>>;
19
20
  type AngularProjectConfiguration = ProjectConfiguration & {
20
21
  prefix?: string;
@@ -23,15 +24,26 @@ export declare class NxScopedHost extends virtualFs.ScopedHost<any> {
23
24
  private root;
24
25
  constructor(root: string);
25
26
  read(path: Path): Observable<FileBuffer>;
26
- private readMergedWorkspaceConfiguration;
27
+ protected readMergedWorkspaceConfiguration(): Observable<any>;
27
28
  write(path: Path, content: FileBuffer): Observable<void>;
28
29
  isFile(path: Path): Observable<boolean>;
29
30
  exists(path: Path): Observable<boolean>;
30
31
  mergeProjectConfiguration(existing: AngularProjectConfiguration, updated: AngularProjectConfiguration, projectName: string): AngularProjectConfiguration;
31
32
  readExistingAngularJson(): Observable<any>;
32
- private readJson;
33
+ protected readJson<T = any>(path: string): Observable<T>;
34
+ }
35
+ /**
36
+ * Host used by Angular CLI builders. It reads the project configurations from
37
+ * the project graph to access the expanded targets.
38
+ */
39
+ export declare class NxScopedHostForBuilders extends NxScopedHost {
40
+ protected readMergedWorkspaceConfiguration(): Observable<any>;
33
41
  }
34
42
  export declare function arrayBufferToString(buffer: any): string;
43
+ /**
44
+ * Host used by Angular CLI schematics. It reads the project configurations from
45
+ * the project configuration files.
46
+ */
35
47
  export declare class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
36
48
  private readonly host;
37
49
  constructor(root: string, host: Tree);
@@ -41,8 +53,8 @@ export declare class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
41
53
  isFile(path: Path): Observable<boolean>;
42
54
  list(path: Path): Observable<PathFragment[]>;
43
55
  }
44
- export declare function generate(root: string, opts: GenerateOptions, verbose: boolean): Promise<number>;
45
- export declare function runMigration(root: string, packageName: string, migrationName: string, isVerbose: boolean): Promise<{
56
+ export declare function generate(root: string, opts: GenerateOptions, projects: Record<string, ProjectConfiguration>, verbose: boolean): Promise<number>;
57
+ export declare function runMigration(root: string, packageName: string, migrationName: string, projects: Record<string, ProjectConfiguration>, isVerbose: boolean): Promise<{
46
58
  loggingQueue: string[];
47
59
  madeChanges: boolean;
48
60
  }>;