nx 21.0.0-beta.1 → 21.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/.eslintrc.json +5 -1
  2. package/migrations.json +5 -35
  3. package/package.json +12 -12
  4. package/release/index.d.ts +1 -1
  5. package/release/index.js +2 -1
  6. package/schemas/nx-schema.json +182 -35
  7. package/schemas/project-schema.json +5 -0
  8. package/src/adapter/compat.d.ts +1 -1
  9. package/src/adapter/compat.js +3 -0
  10. package/src/command-line/add/add.js +6 -16
  11. package/src/command-line/affected/command-object.js +6 -6
  12. package/src/command-line/examples.js +0 -4
  13. package/src/command-line/exec/command-object.js +1 -1
  14. package/src/command-line/generate/generator-utils.js +8 -3
  15. package/src/command-line/import/import.js +1 -1
  16. package/src/command-line/init/command-object.js +18 -6
  17. package/src/command-line/init/configure-plugins.d.ts +6 -7
  18. package/src/command-line/init/configure-plugins.js +52 -38
  19. package/src/command-line/init/implementation/add-nx-to-turborepo.d.ts +4 -0
  20. package/src/command-line/init/implementation/add-nx-to-turborepo.js +49 -0
  21. package/src/command-line/init/implementation/check-compatible-with-plugins.js +7 -1
  22. package/src/command-line/init/implementation/deduce-default-base.d.ts +1 -0
  23. package/src/command-line/init/implementation/deduce-default-base.js +53 -0
  24. package/src/command-line/init/implementation/react/add-vite-commands-to-package-scripts.js +6 -4
  25. package/src/command-line/init/implementation/react/index.d.ts +1 -1
  26. package/src/command-line/init/implementation/react/index.js +32 -185
  27. package/src/command-line/init/implementation/react/write-vite-config.js +19 -3
  28. package/src/command-line/init/implementation/utils.d.ts +6 -2
  29. package/src/command-line/init/implementation/utils.js +110 -45
  30. package/src/command-line/init/init-v1.js +1 -1
  31. package/src/command-line/init/init-v2.d.ts +1 -0
  32. package/src/command-line/init/init-v2.js +70 -39
  33. package/src/command-line/migrate/migrate-ui-api.d.ts +58 -0
  34. package/src/command-line/migrate/migrate-ui-api.js +227 -0
  35. package/src/command-line/migrate/migrate.d.ts +16 -3
  36. package/src/command-line/migrate/migrate.js +113 -83
  37. package/src/command-line/nx-commands.js +19 -5
  38. package/src/command-line/register/command-object.d.ts +6 -0
  39. package/src/command-line/{activate-powerpack → register}/command-object.js +9 -9
  40. package/src/command-line/register/register.d.ts +2 -0
  41. package/src/command-line/register/register.js +9 -0
  42. package/src/command-line/release/changelog.js +18 -15
  43. package/src/command-line/release/command-object.d.ts +8 -0
  44. package/src/command-line/release/command-object.js +9 -0
  45. package/src/command-line/release/config/config.d.ts +8 -7
  46. package/src/command-line/release/config/config.js +139 -45
  47. package/src/command-line/release/config/use-legacy-versioning.d.ts +2 -0
  48. package/src/command-line/release/config/use-legacy-versioning.js +9 -0
  49. package/src/command-line/release/index.d.ts +4 -0
  50. package/src/command-line/release/index.js +6 -1
  51. package/src/command-line/release/plan-check.js +6 -3
  52. package/src/command-line/release/plan.js +7 -3
  53. package/src/command-line/release/publish.js +7 -3
  54. package/src/command-line/release/release.js +8 -3
  55. package/src/command-line/release/utils/batch-projects-by-generator-config.js +6 -3
  56. package/src/command-line/release/utils/git.d.ts +3 -2
  57. package/src/command-line/release/utils/git.js +65 -9
  58. package/src/command-line/release/utils/github.js +3 -1
  59. package/src/command-line/release/utils/resolve-semver-specifier.d.ts +2 -1
  60. package/src/command-line/release/utils/resolve-semver-specifier.js +2 -1
  61. package/src/command-line/release/utils/semver.d.ts +8 -0
  62. package/src/command-line/release/utils/semver.js +8 -0
  63. package/src/command-line/release/utils/shared-legacy.d.ts +25 -0
  64. package/src/command-line/release/utils/shared-legacy.js +2 -0
  65. package/src/command-line/release/utils/shared.d.ts +11 -17
  66. package/src/command-line/release/version/derive-specifier-from-conventional-commits.d.ts +7 -0
  67. package/src/command-line/release/version/derive-specifier-from-conventional-commits.js +47 -0
  68. package/src/command-line/release/version/deriver-specifier-from-version-plans.d.ts +8 -0
  69. package/src/command-line/release/version/deriver-specifier-from-version-plans.js +59 -0
  70. package/src/command-line/release/version/project-logger.d.ts +8 -0
  71. package/src/command-line/release/version/project-logger.js +45 -0
  72. package/src/command-line/release/version/release-group-processor.d.ts +252 -0
  73. package/src/command-line/release/version/release-group-processor.js +1057 -0
  74. package/src/command-line/release/version/resolve-current-version.d.ts +32 -0
  75. package/src/command-line/release/version/resolve-current-version.js +241 -0
  76. package/src/command-line/release/version/test-utils.d.ts +93 -0
  77. package/src/command-line/release/version/test-utils.js +415 -0
  78. package/src/command-line/release/version/topological-sort.d.ts +9 -0
  79. package/src/command-line/release/version/topological-sort.js +41 -0
  80. package/src/command-line/release/version/version-actions.d.ts +171 -0
  81. package/src/command-line/release/version/version-actions.js +195 -0
  82. package/src/command-line/release/version-legacy.d.ts +46 -0
  83. package/src/command-line/release/version-legacy.js +453 -0
  84. package/src/command-line/release/version.d.ts +0 -40
  85. package/src/command-line/release/version.js +84 -262
  86. package/src/command-line/repair/repair.js +0 -1
  87. package/src/command-line/report/report.d.ts +7 -3
  88. package/src/command-line/report/report.js +52 -18
  89. package/src/command-line/run/command-object.js +2 -2
  90. package/src/command-line/run/executor-utils.d.ts +6 -1
  91. package/src/command-line/run/executor-utils.js +10 -1
  92. package/src/command-line/run/run.js +2 -2
  93. package/src/command-line/run-many/command-object.js +2 -2
  94. package/src/command-line/yargs-utils/shared-options.d.ts +4 -0
  95. package/src/command-line/yargs-utils/shared-options.js +20 -0
  96. package/src/config/misc-interfaces.d.ts +11 -1
  97. package/src/config/nx-json.d.ts +160 -16
  98. package/src/config/project-graph.d.ts +4 -2
  99. package/src/config/project-graph.js +8 -0
  100. package/src/config/workspace-json-project-json.d.ts +2 -2
  101. package/src/core/graph/main.js +1 -1
  102. package/src/core/graph/runtime.js +1 -1
  103. package/src/core/graph/styles.css +2 -2
  104. package/src/core/graph/styles.js +1 -1
  105. package/src/daemon/client/client.d.ts +2 -0
  106. package/src/daemon/client/client.js +15 -0
  107. package/src/daemon/message-types/glob.d.ts +7 -0
  108. package/src/daemon/message-types/glob.js +9 -1
  109. package/src/daemon/message-types/hash-glob.d.ts +6 -0
  110. package/src/daemon/message-types/hash-glob.js +9 -1
  111. package/src/daemon/server/handle-glob.d.ts +1 -0
  112. package/src/daemon/server/handle-glob.js +8 -0
  113. package/src/daemon/server/handle-hash-glob.d.ts +1 -0
  114. package/src/daemon/server/handle-hash-glob.js +8 -0
  115. package/src/daemon/server/logger.js +2 -1
  116. package/src/daemon/server/server.js +7 -0
  117. package/src/devkit-internals.d.ts +3 -2
  118. package/src/devkit-internals.js +5 -1
  119. package/src/executors/run-commands/run-commands.impl.d.ts +2 -5
  120. package/src/executors/run-commands/run-commands.impl.js +14 -42
  121. package/src/executors/run-commands/running-tasks.d.ts +9 -4
  122. package/src/executors/run-commands/running-tasks.js +103 -30
  123. package/src/executors/run-script/run-script.impl.js +4 -3
  124. package/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +8 -0
  125. package/src/generators/testing-utils/create-tree.js +5 -1
  126. package/src/migrations/{update-17-0-0/rm-default-collection-npm-scope.d.ts → update-21-0-0/release-version-config-changes.d.ts} +1 -1
  127. package/src/migrations/update-21-0-0/release-version-config-changes.js +111 -0
  128. package/src/native/index.d.ts +98 -19
  129. package/src/native/index.js +16 -2
  130. package/src/native/native-bindings.js +7 -0
  131. package/src/native/nx.wasi-browser.js +20 -19
  132. package/src/native/nx.wasi.cjs +20 -19
  133. package/src/native/nx.wasm32-wasi.wasm +0 -0
  134. package/src/nx-cloud/nx-cloud-tasks-runner-shell.js +3 -3
  135. package/src/plugins/js/lock-file/lock-file.js +28 -13
  136. package/src/plugins/js/lock-file/utils/package-json.d.ts +1 -1
  137. package/src/plugins/js/lock-file/utils/package-json.js +8 -6
  138. package/src/plugins/js/lock-file/utils/pnpm-normalizer.js +3 -3
  139. package/src/plugins/js/lock-file/yarn-parser.js +85 -39
  140. package/src/plugins/js/project-graph/affected/lock-file-changes.js +1 -0
  141. package/src/plugins/js/project-graph/build-dependencies/explicit-project-dependencies.js +1 -1
  142. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.d.ts +10 -1
  143. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +59 -6
  144. package/src/plugins/js/utils/packages.js +22 -3
  145. package/src/plugins/js/utils/register.js +1 -0
  146. package/src/plugins/js/utils/typescript.js +3 -3
  147. package/src/plugins/package-json/create-nodes.d.ts +1 -1
  148. package/src/plugins/package-json/create-nodes.js +4 -2
  149. package/src/project-graph/affected/locators/project-glob-changes.js +2 -2
  150. package/src/project-graph/error-types.js +32 -2
  151. package/src/project-graph/file-utils.d.ts +1 -10
  152. package/src/project-graph/file-utils.js +2 -77
  153. package/src/project-graph/plugins/get-plugins.js +2 -1
  154. package/src/project-graph/plugins/in-process-loader.js +1 -1
  155. package/src/project-graph/plugins/isolation/plugin-worker.js +12 -6
  156. package/src/project-graph/plugins/loaded-nx-plugin.d.ts +2 -1
  157. package/src/project-graph/plugins/public-api.d.ts +1 -1
  158. package/src/project-graph/plugins/utils.d.ts +2 -2
  159. package/src/project-graph/plugins/utils.js +2 -2
  160. package/src/project-graph/project-graph.js +1 -1
  161. package/src/project-graph/utils/project-configuration-utils.d.ts +3 -3
  162. package/src/project-graph/utils/project-configuration-utils.js +54 -21
  163. package/src/project-graph/utils/retrieve-workspace-files.d.ts +1 -1
  164. package/src/project-graph/utils/retrieve-workspace-files.js +14 -18
  165. package/src/tasks-runner/batch/batch-messages.d.ts +2 -0
  166. package/src/tasks-runner/batch/run-batch.js +3 -4
  167. package/src/tasks-runner/cache.d.ts +20 -6
  168. package/src/tasks-runner/cache.js +104 -20
  169. package/src/tasks-runner/create-task-graph.d.ts +0 -1
  170. package/src/tasks-runner/create-task-graph.js +11 -11
  171. package/src/tasks-runner/default-tasks-runner.js +5 -14
  172. package/src/tasks-runner/forked-process-task-runner.d.ts +8 -3
  173. package/src/tasks-runner/forked-process-task-runner.js +59 -46
  174. package/src/tasks-runner/init-tasks-runner.d.ts +15 -1
  175. package/src/tasks-runner/init-tasks-runner.js +62 -2
  176. package/src/tasks-runner/is-tui-enabled.d.ts +2 -0
  177. package/src/tasks-runner/is-tui-enabled.js +64 -0
  178. package/src/tasks-runner/life-cycle.d.ts +14 -3
  179. package/src/tasks-runner/life-cycle.js +37 -2
  180. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.d.ts +2 -0
  181. package/src/tasks-runner/life-cycles/task-history-life-cycle-old.js +15 -7
  182. package/src/tasks-runner/life-cycles/task-history-life-cycle.d.ts +5 -0
  183. package/src/tasks-runner/life-cycles/task-history-life-cycle.js +35 -5
  184. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.d.ts +18 -0
  185. package/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +229 -0
  186. package/src/tasks-runner/pseudo-terminal.d.ts +10 -7
  187. package/src/tasks-runner/pseudo-terminal.js +37 -35
  188. package/src/tasks-runner/run-command.d.ts +4 -1
  189. package/src/tasks-runner/run-command.js +220 -42
  190. package/src/tasks-runner/running-tasks/node-child-process.js +4 -11
  191. package/src/tasks-runner/running-tasks/running-task.d.ts +3 -0
  192. package/src/tasks-runner/running-tasks/shared-running-task.d.ts +14 -0
  193. package/src/tasks-runner/running-tasks/shared-running-task.js +30 -0
  194. package/src/tasks-runner/task-env.d.ts +1 -4
  195. package/src/tasks-runner/task-env.js +2 -0
  196. package/src/tasks-runner/task-orchestrator.d.ts +26 -10
  197. package/src/tasks-runner/task-orchestrator.js +212 -57
  198. package/src/tasks-runner/tasks-runner.d.ts +1 -0
  199. package/src/tasks-runner/tasks-schedule.d.ts +1 -0
  200. package/src/tasks-runner/tasks-schedule.js +9 -0
  201. package/src/tasks-runner/utils.d.ts +2 -2
  202. package/src/tasks-runner/utils.js +18 -12
  203. package/src/utils/child-process.d.ts +4 -0
  204. package/src/utils/child-process.js +23 -30
  205. package/src/utils/command-line-utils.d.ts +1 -1
  206. package/src/utils/find-matching-projects.js +2 -2
  207. package/src/utils/git-utils.d.ts +1 -1
  208. package/src/utils/git-utils.js +8 -3
  209. package/src/utils/handle-errors.js +15 -0
  210. package/src/utils/is-ci.js +4 -1
  211. package/src/utils/is-using-prettier.d.ts +3 -0
  212. package/src/utils/is-using-prettier.js +62 -0
  213. package/src/utils/nx-key.d.ts +7 -0
  214. package/src/utils/nx-key.js +52 -0
  215. package/src/utils/package-json.d.ts +1 -1
  216. package/src/utils/package-json.js +16 -2
  217. package/src/utils/package-manager.js +2 -2
  218. package/src/utils/path.js +1 -1
  219. package/src/utils/require-nx-key.d.ts +1 -0
  220. package/src/utils/require-nx-key.js +22 -0
  221. package/src/utils/workspace-context.d.ts +2 -0
  222. package/src/utils/workspace-context.js +16 -0
  223. package/src/command-line/activate-powerpack/activate-powerpack.d.ts +0 -2
  224. package/src/command-line/activate-powerpack/activate-powerpack.js +0 -34
  225. package/src/command-line/activate-powerpack/command-object.d.ts +0 -6
  226. package/src/command-line/init/implementation/react/write-craco-config.d.ts +0 -1
  227. package/src/command-line/init/implementation/react/write-craco-config.js +0 -61
  228. package/src/migrations/update-17-0-0/move-cache-directory.d.ts +0 -2
  229. package/src/migrations/update-17-0-0/move-cache-directory.js +0 -35
  230. package/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +0 -72
  231. package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.d.ts +0 -2
  232. package/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +0 -122
  233. package/src/migrations/update-17-2-0/move-default-base.d.ts +0 -5
  234. package/src/migrations/update-17-2-0/move-default-base.js +0 -21
  235. package/src/migrations/update-17-3-0/nx-release-path.d.ts +0 -3
  236. package/src/migrations/update-17-3-0/nx-release-path.js +0 -47
  237. package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.d.ts +0 -2
  238. package/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +0 -11
  239. package/src/utils/powerpack.d.ts +0 -5
  240. package/src/utils/powerpack.js +0 -33
@@ -1,7 +1,12 @@
1
1
  import { ExecutorConfig } from '../../config/misc-interfaces';
2
2
  import { ProjectConfiguration } from '../../config/workspace-json-project-json';
3
3
  export declare function normalizeExecutorSchema(schema: Partial<ExecutorConfig['schema']>): ExecutorConfig['schema'];
4
- export declare function getExecutorInformation(nodeModule: string, executor: string, root: string, projects: Record<string, ProjectConfiguration>): ExecutorConfig & {
4
+ export declare function parseExecutor(executorString: string): [module: string, name: string];
5
+ export declare function getExecutorInformation(nodeModule: string, executor: string, root: string,
6
+ /**
7
+ * A map of projects keyed by project name
8
+ */
9
+ projects: Record<string, ProjectConfiguration>): ExecutorConfig & {
5
10
  isNgCompat: boolean;
6
11
  isNxExecutor: boolean;
7
12
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeExecutorSchema = normalizeExecutorSchema;
4
+ exports.parseExecutor = parseExecutor;
4
5
  exports.getExecutorInformation = getExecutorInformation;
5
6
  const path_1 = require("path");
6
7
  const plugins_1 = require("../../project-graph/plugins");
@@ -12,6 +13,7 @@ function normalizeExecutorSchema(schema) {
12
13
  return {
13
14
  version,
14
15
  outputCapture: schema.outputCapture ?? version < 2 ? 'direct-nodejs' : 'pipe',
16
+ continuous: schema.continuous ?? false,
15
17
  properties: !schema.properties || typeof schema.properties !== 'object'
16
18
  ? {}
17
19
  : schema.properties,
@@ -21,8 +23,15 @@ function normalizeExecutorSchema(schema) {
21
23
  function cacheKey(nodeModule, executor, root) {
22
24
  return `${root}:${nodeModule}:${executor}`;
23
25
  }
26
+ function parseExecutor(executorString) {
27
+ return executorString.split(':');
28
+ }
24
29
  const cachedExecutorInformation = {};
25
- function getExecutorInformation(nodeModule, executor, root, projects) {
30
+ function getExecutorInformation(nodeModule, executor, root,
31
+ /**
32
+ * A map of projects keyed by project name
33
+ */
34
+ projects) {
26
35
  try {
27
36
  const key = cacheKey(nodeModule, executor, root);
28
37
  if (cachedExecutorInformation[key])
@@ -45,7 +45,7 @@ async function parseExecutorAndTarget({ project, target }, root, projectsConfigu
45
45
  if (!targetConfig) {
46
46
  throw new Error(`Cannot find target '${target}' for project '${project}'`);
47
47
  }
48
- const [nodeModule, executor] = targetConfig.executor.split(':');
48
+ const [nodeModule, executor] = (0, executor_utils_1.parseExecutor)(targetConfig.executor);
49
49
  const { schema, implementationFactory } = (0, executor_utils_1.getExecutorInformation)(nodeModule, executor, root, projectsConfigurations.projects);
50
50
  return { executor, implementationFactory, nodeModule, schema, targetConfig };
51
51
  }
@@ -66,7 +66,7 @@ async function printTargetRunHelpInternal({ project, target }, root, projectsCon
66
66
  ...localEnv,
67
67
  };
68
68
  if (pseudo_terminal_1.PseudoTerminal.isSupported()) {
69
- const terminal = (0, pseudo_terminal_1.getPseudoTerminal)();
69
+ const terminal = (0, pseudo_terminal_1.createPseudoTerminal)();
70
70
  await new Promise(() => {
71
71
  const cp = terminal.runCommand(helpCommand, { jsEnv: env });
72
72
  cp.onExit((code) => {
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsRunManyCommand = void 0;
4
+ const handle_errors_1 = require("../../utils/handle-errors");
4
5
  const documentation_1 = require("../yargs-utils/documentation");
5
6
  const shared_options_1 = require("../yargs-utils/shared-options");
6
- const handle_errors_1 = require("../../utils/handle-errors");
7
7
  exports.yargsRunManyCommand = {
8
8
  command: 'run-many',
9
9
  describe: 'Run target for multiple listed projects.',
10
- builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withRunManyOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs)))), 'run-many'),
10
+ builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withTuiOptions)((0, shared_options_1.withRunManyOptions)((0, shared_options_1.withOutputStyleOption)((0, shared_options_1.withTargetAndConfigurationOption)((0, shared_options_1.withBatch)(yargs))))), 'run-many'),
11
11
  handler: async (args) => {
12
12
  const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose ?? process.env.NX_VERBOSE_LOGGING === 'true', async () => {
13
13
  await Promise.resolve().then(() => require('./run-many')).then((m) => m.runMany((0, shared_options_1.withOverrides)(args)));
@@ -23,6 +23,10 @@ export interface RunOptions {
23
23
  excludeTaskDependencies: boolean;
24
24
  skipSync: boolean;
25
25
  }
26
+ export interface TuiOptions {
27
+ tuiAutoExit: boolean | number;
28
+ }
29
+ export declare function withTuiOptions<T>(yargs: Argv<T>): Argv<T & TuiOptions>;
26
30
  export declare function withRunOptions<T>(yargs: Argv<T>): Argv<T & RunOptions>;
27
31
  export declare function withTargetAndConfigurationOption(yargs: Argv, demandOption?: boolean): Argv<{
28
32
  configuration: string;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultYargsParserConfiguration = void 0;
4
4
  exports.withExcludeOption = withExcludeOption;
5
+ exports.withTuiOptions = withTuiOptions;
5
6
  exports.withRunOptions = withRunOptions;
6
7
  exports.withTargetAndConfigurationOption = withTargetAndConfigurationOption;
7
8
  exports.withConfiguration = withConfiguration;
@@ -28,6 +29,25 @@ function withExcludeOption(yargs) {
28
29
  coerce: parseCSV,
29
30
  });
30
31
  }
32
+ function withTuiOptions(yargs) {
33
+ return yargs.options('tuiAutoExit', {
34
+ describe: 'Whether or not to exit the TUI automatically after all tasks finish, and after how long. If set to `true`, the TUI will exit immediately. If set to `false` the TUI will not automatically exit. If set to a number, an interruptible countdown popup will be shown for that many seconds before the TUI exits.',
35
+ type: 'string',
36
+ coerce: (value) => {
37
+ if (value === 'true') {
38
+ return true;
39
+ }
40
+ if (value === 'false') {
41
+ return false;
42
+ }
43
+ const num = Number(value);
44
+ if (!Number.isNaN(num)) {
45
+ return num;
46
+ }
47
+ throw new Error(`Invalid value for --tui-auto-exit: ${value}`);
48
+ },
49
+ });
50
+ }
31
51
  function withRunOptions(yargs) {
32
52
  return withVerbose(withExcludeOption(yargs))
33
53
  .option('parallel', {
@@ -53,11 +53,20 @@ export type PackageJsonUpdates = {
53
53
  export interface MigrationsJsonEntry {
54
54
  version: string;
55
55
  description?: string;
56
- cli?: string;
57
56
  implementation?: string;
58
57
  factory?: string;
59
58
  requires?: Record<string, string>;
60
59
  }
60
+ export type MigrationDetailsWithId = GeneratedMigrationDetails & {
61
+ id: string;
62
+ };
63
+ export interface GeneratedMigrationDetails {
64
+ name: string;
65
+ version: string;
66
+ package: string;
67
+ description: string;
68
+ implementation: string;
69
+ }
61
70
  export interface MigrationsJson {
62
71
  name?: string;
63
72
  version?: string;
@@ -83,6 +92,7 @@ export interface ExecutorConfig {
83
92
  schema: {
84
93
  version?: number;
85
94
  outputCapture?: OutputCaptureMethod;
95
+ continuous?: boolean;
86
96
  } & Schema;
87
97
  hasherFactory?: () => CustomHasher;
88
98
  implementationFactory: () => Executor;
@@ -1,6 +1,7 @@
1
1
  import type { ChangelogRenderOptions } from '../../release/changelog-renderer';
2
- import { PackageManager } from '../utils/package-manager';
3
- import { InputDefinition, TargetConfiguration, TargetDependencyConfig } from './workspace-json-project-json';
2
+ import type { validReleaseVersionPrefixes } from '../command-line/release/version';
3
+ import type { PackageManager } from '../utils/package-manager';
4
+ import type { InputDefinition, TargetConfiguration, TargetDependencyConfig } from './workspace-json-project-json';
4
5
  export type ImplicitDependencyEntry<T = '*' | string[]> = {
5
6
  [key: string]: T | ImplicitJsonSubsetDependency<T>;
6
7
  };
@@ -35,7 +36,13 @@ interface NxInstallationConfiguration {
35
36
  */
36
37
  plugins?: Record<string, string>;
37
38
  }
38
- export interface NxReleaseVersionConfiguration {
39
+ /**
40
+ * This named configuration interface represents the options prior to Nx v21. This interface will be made available
41
+ * under LegacyNxReleaseVersionConfiguration throughout the lifetime of Nx v21.
42
+ *
43
+ * In Nx v22, this configuration interface will no longer be valid.
44
+ */
45
+ export interface LegacyNxReleaseVersionConfiguration {
39
46
  generator?: string;
40
47
  generatorOptions?: Record<string, unknown>;
41
48
  /**
@@ -50,6 +57,106 @@ export interface NxReleaseVersionConfiguration {
50
57
  */
51
58
  conventionalCommits?: boolean;
52
59
  }
60
+ export type ManifestRootToUpdate = string | {
61
+ path: string;
62
+ preserveLocalDependencyProtocols: boolean;
63
+ };
64
+ export interface NxReleaseVersionConfiguration {
65
+ /**
66
+ * Whether to use the legacy versioning strategy. This value was true in Nx v20 and became false in Nx v21.
67
+ * The legacy versioning implementation will be removed in Nx v22, as will this flag.
68
+ */
69
+ useLegacyVersioning?: boolean;
70
+ /**
71
+ * Shorthand for enabling the current version of projects to be resolved from git tags,
72
+ * and the next version to be determined by analyzing commit messages according to the
73
+ * Conventional Commits specification.
74
+ */
75
+ conventionalCommits?: boolean;
76
+ /**
77
+ * A command to run after validation of nx release configuration, but before versioning begins.
78
+ * Useful for preparing build artifacts. If --dry-run is passed, the command is still executed,
79
+ * but with the NX_DRY_RUN environment variable set to 'true'.
80
+ */
81
+ preVersionCommand?: string;
82
+ /**
83
+ * The source to use for determining the specifier to use when versioning.
84
+ * 'prompt' is the default and will interactively prompt the user for an explicit/imperative specifier.
85
+ * 'conventional-commits' will attempt determine a specifier from commit messages conforming to the Conventional Commits specification.
86
+ * 'version-plans' will determine the specifier from the version plan files available on disk.
87
+ */
88
+ specifierSource?: 'prompt' | 'conventional-commits' | 'version-plans';
89
+ /**
90
+ * A list of directories containing manifest files (such as package.json) to apply updates to when versioning.
91
+ *
92
+ * By default, only the project root will be used, but you could customize this to only version a manifest in a
93
+ * dist directory, or even version multiple manifests in different directories, such as both source and dist.
94
+ *
95
+ * For more advanced scenarios, the preserveLocalDependencyProtocols can be overridden per manifest by providing
96
+ * and object instead of a string.
97
+ */
98
+ manifestRootsToUpdate?: ManifestRootToUpdate[];
99
+ /**
100
+ * The resolver to use for determining the current version of a project during versioning.
101
+ * This is needed for versioning approaches which involve relatively modifying a current version
102
+ * to arrive at a new version, such as semver bumps like 'patch', 'minor' etc.
103
+ *
104
+ * Using 'none' explicitly declares that the current version is not needed to compute the new version, and
105
+ * should only be used with appropriate version actions implementations that support it.
106
+ */
107
+ currentVersionResolver?: 'registry' | 'disk' | 'git-tag' | 'none';
108
+ /**
109
+ * Metadata to provide to the configured currentVersionResolver to help it in determining the current version.
110
+ * What to pass here is specific to each resolver.
111
+ */
112
+ currentVersionResolverMetadata?: Record<string, unknown>;
113
+ /**
114
+ * The fallback version resolver to use when the configured currentVersionResolver fails to resolve the current version.
115
+ */
116
+ fallbackCurrentVersionResolver?: 'disk';
117
+ /**
118
+ * Whether or not this is the first release of one of more projects.
119
+ * This removes certain validation checks that are not possible to enforce if the project has never been released before.
120
+ */
121
+ firstRelease?: boolean;
122
+ /**
123
+ * The prefix to use when versioning dependencies.
124
+ * This can be one of the following: auto, '', '~', '^', '=', where auto means the existing prefix will be preserved.
125
+ */
126
+ versionPrefix?: (typeof validReleaseVersionPrefixes)[number];
127
+ /**
128
+ * Whether to delete the processed version plans file after versioning is complete. This is false by default because the
129
+ * version plans are also needed for changelog generation.
130
+ */
131
+ deleteVersionPlans?: boolean;
132
+ /**
133
+ * When versioning independent projects, this controls whether to update their dependents (i.e. the things that depend on them).
134
+ * 'never' means no dependents will be updated (unless they happen to be versioned directly as well).
135
+ * 'auto' is the default and will cause dependents to be updated (a patch version bump) when a dependency is versioned.
136
+ */
137
+ updateDependents?: 'auto' | 'never';
138
+ /**
139
+ * Whether to log projects that have not changed during versioning.
140
+ */
141
+ logUnchangedProjects?: boolean;
142
+ /**
143
+ * The path to the version actions implementation to use for releasing all projects by default.
144
+ * This can also be overridden on the release group and project levels.
145
+ */
146
+ versionActions?: string;
147
+ /**
148
+ * The specific options that are defined by each version actions implementation.
149
+ * They will be passed to the version actions implementation when running a release.
150
+ */
151
+ versionActionsOptions?: Record<string, unknown>;
152
+ /**
153
+ * Whether to preserve local dependency protocols (e.g. file references, or the `workspace:` protocol in package.json files)
154
+ * of local dependencies when updating them during versioning.
155
+ *
156
+ * This was false by default in legacy versioning, but is true by default now.
157
+ */
158
+ preserveLocalDependencyProtocols?: boolean;
159
+ }
53
160
  export interface NxReleaseChangelogConfiguration {
54
161
  /**
55
162
  * Optionally create a release containing all relevant changes on a supported version control system, it
@@ -131,6 +238,10 @@ export interface NxReleaseGitConfiguration {
131
238
  * Whether or not to automatically push the changes made by this command to the remote git repository.
132
239
  */
133
240
  push?: boolean;
241
+ /**
242
+ * Additional arguments to pass to the `git push` command invoked behind the scenes. May be a string or array of strings.
243
+ */
244
+ pushArgs?: string | string[];
134
245
  }
135
246
  export interface NxReleaseConventionalCommitsConfiguration {
136
247
  types?: Record<string,
@@ -190,7 +301,7 @@ export interface NxReleaseConfiguration {
190
301
  *
191
302
  * NOTE: git configuration is not supported at the group level, only the root/command level
192
303
  */
193
- version?: NxReleaseVersionConfiguration & {
304
+ version?: (LegacyNxReleaseVersionConfiguration | NxReleaseVersionConfiguration) & {
194
305
  /**
195
306
  * A command to run after validation of nx release configuration, but before versioning begins.
196
307
  * Used for preparing build artifacts. If --dry-run is passed, the command is still executed, but
@@ -215,6 +326,15 @@ export interface NxReleaseConfiguration {
215
326
  * Optionally override the git/release tag pattern to use for this group.
216
327
  */
217
328
  releaseTagPattern?: string;
329
+ /**
330
+ * By default, we will try and resolve the latest match for the releaseTagPattern from the current branch,
331
+ * falling back to all branches if no match is found on the current branch.
332
+ *
333
+ * - Setting this to true will cause us to ALWAYS check all branches for the latest match.
334
+ * - Setting it to false will cause us to ONLY check the current branch for the latest match.
335
+ * - Setting it to an array of strings will cause us to check all branches WHEN the current branch matches one of the strings in the array. Glob patterns are supported.
336
+ */
337
+ releaseTagPatternCheckAllBranchesWhen?: boolean | string[];
218
338
  /**
219
339
  * Enables using version plans as a specifier source for versioning and
220
340
  * to determine changes for changelog generation.
@@ -255,19 +375,12 @@ export interface NxReleaseConfiguration {
255
375
  automaticFromRef?: boolean;
256
376
  };
257
377
  /**
258
- * If no version config is provided, we will assume that @nx/js:release-version
259
- * is the desired generator implementation, allowing for terser config for the common case.
378
+ * If no version configuration is provided, we will assume that TypeScript/JavaScript experience is what is desired,
379
+ * allowing for terser release configuration for the common case.
260
380
  */
261
- version?: NxReleaseVersionConfiguration & {
262
- /**
263
- * Enable or override configuration for git operations as part of the version subcommand
264
- */
381
+ version?: (LegacyNxReleaseVersionConfiguration | NxReleaseVersionConfiguration) & {
382
+ useLegacyVersioning?: boolean;
265
383
  git?: NxReleaseGitConfiguration;
266
- /**
267
- * A command to run after validation of nx release configuration, but before versioning begins.
268
- * Used for preparing build artifacts. If --dry-run is passed, the command is still executed, but
269
- * with the NX_DRY_RUN environment variable set to 'true'.
270
- */
271
384
  preVersionCommand?: string;
272
385
  };
273
386
  /**
@@ -281,6 +394,15 @@ export interface NxReleaseConfiguration {
281
394
  * The default releaseTagPattern for independent releases at the project level is: "{projectName}@{version}"
282
395
  */
283
396
  releaseTagPattern?: string;
397
+ /**
398
+ * By default, we will try and resolve the latest match for the releaseTagPattern from the current branch,
399
+ * falling back to all branches if no match is found on the current branch.
400
+ *
401
+ * - Setting this to true will cause us to ALWAYS check all branches for the latest match.
402
+ * - Setting it to false will cause us to ONLY check the current branch for the latest match.
403
+ * - Setting it to an array of strings will cause us to check all branches WHEN the current branch matches one of the strings in the array. Glob patterns are supported.
404
+ */
405
+ releaseTagPatternCheckAllBranchesWhen?: boolean | string[];
284
406
  /**
285
407
  * Enable and configure automatic git operations as part of the release
286
408
  */
@@ -321,6 +443,7 @@ export interface NxSyncConfiguration {
321
443
  * @note: when adding properties here add them to `allowedWorkspaceExtensions` in adapter/compat.ts
322
444
  */
323
445
  export interface NxJsonConfiguration<T = '*' | string[]> {
446
+ $schema?: string;
324
447
  /**
325
448
  * Optional (additional) Nx.json configuration file which becomes a base for this one
326
449
  */
@@ -357,7 +480,7 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
357
480
  appsDir?: string;
358
481
  };
359
482
  /**
360
- * @deprecated Custom task runners will no longer be supported in Nx 21. Use Nx Cloud or Nx Powerpack instead.
483
+ * @deprecated Custom task runners will be replaced by a new API starting with Nx 21. More info: https://nx.dev/deprecated/custom-tasks-runner
361
484
  * Available Task Runners for Nx to use
362
485
  */
363
486
  tasksRunnerOptions?: {
@@ -471,6 +594,27 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
471
594
  * Use the legacy file system cache instead of the db cache
472
595
  */
473
596
  useLegacyCache?: boolean;
597
+ /**
598
+ * Sets the maximum size of the local cache. Accepts a number followed by a unit (e.g. 100MB). Accepted units are B, KB, MB, and GB.
599
+ */
600
+ maxCacheSize?: string;
601
+ /**
602
+ * Settings for the Nx Terminal User Interface (TUI)
603
+ */
604
+ tui?: {
605
+ /**
606
+ * Whether to enable the TUI whenever possible (based on the current environment and terminal).
607
+ */
608
+ enabled?: boolean;
609
+ /**
610
+ * Whether to exit the TUI automatically after all tasks finish.
611
+ *
612
+ * - If set to `true`, the TUI will exit immediately.
613
+ * - If set to `false` the TUI will not automatically exit.
614
+ * - If set to a number, an interruptible countdown popup will be shown for that many seconds before the TUI exits.
615
+ */
616
+ autoExit?: boolean | number;
617
+ };
474
618
  }
475
619
  export type PluginConfiguration = string | ExpandedPluginConfiguration;
476
620
  export type ExpandedPluginConfiguration<T = unknown> = {
@@ -74,6 +74,7 @@ export interface ProjectGraphProjectNode {
74
74
  description?: string;
75
75
  };
76
76
  }
77
+ export declare function isProjectGraphProjectNode(node: ProjectGraphProjectNode | ProjectGraphExternalNode): node is ProjectGraphProjectNode;
77
78
  /**
78
79
  * A node describing an external dependency
79
80
  * `name` has as form of:
@@ -85,14 +86,15 @@ export interface ProjectGraphProjectNode {
85
86
  *
86
87
  */
87
88
  export interface ProjectGraphExternalNode {
88
- type: 'npm';
89
- name: `npm:${string}`;
89
+ type: string;
90
+ name: string;
90
91
  data: {
91
92
  version: string;
92
93
  packageName: string;
93
94
  hash?: string;
94
95
  };
95
96
  }
97
+ export declare function isProjectGraphExternalNode(node: ProjectGraphProjectNode | ProjectGraphExternalNode): node is ProjectGraphExternalNode;
96
98
  /**
97
99
  * A dependency between two projects
98
100
  */
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DependencyType = void 0;
4
4
  exports.fileDataDepTarget = fileDataDepTarget;
5
5
  exports.fileDataDepType = fileDataDepType;
6
+ exports.isProjectGraphProjectNode = isProjectGraphProjectNode;
7
+ exports.isProjectGraphExternalNode = isProjectGraphExternalNode;
6
8
  function fileDataDepTarget(dep) {
7
9
  return typeof dep === 'string'
8
10
  ? dep
@@ -35,3 +37,9 @@ var DependencyType;
35
37
  */
36
38
  DependencyType["implicit"] = "implicit";
37
39
  })(DependencyType || (exports.DependencyType = DependencyType = {}));
40
+ function isProjectGraphProjectNode(node) {
41
+ return node.type === 'app' || node.type === 'e2e' || node.type === 'lib';
42
+ }
43
+ function isProjectGraphExternalNode(node) {
44
+ return isProjectGraphProjectNode(node) === false;
45
+ }
@@ -1,5 +1,5 @@
1
1
  import type { PackageJson } from '../utils/package-json';
2
- import type { NxJsonConfiguration, NxReleaseVersionConfiguration } from './nx-json';
2
+ import type { LegacyNxReleaseVersionConfiguration, NxJsonConfiguration, NxReleaseVersionConfiguration } from './nx-json';
3
3
  /**
4
4
  * @deprecated use ProjectsConfigurations or NxJsonConfiguration
5
5
  */
@@ -98,7 +98,7 @@ export interface ProjectConfiguration {
98
98
  * Project specific configuration for `nx release`
99
99
  */
100
100
  release?: {
101
- version?: Pick<NxReleaseVersionConfiguration, 'generator' | 'generatorOptions'>;
101
+ version?: Pick<LegacyNxReleaseVersionConfiguration, 'generator' | 'generatorOptions'> | Pick<NxReleaseVersionConfiguration, 'versionActions' | 'versionActionsOptions' | 'manifestRootsToUpdate' | 'currentVersionResolver' | 'currentVersionResolverMetadata' | 'fallbackCurrentVersionResolver' | 'versionPrefix' | 'preserveLocalDependencyProtocols'>;
102
102
  };
103
103
  /**
104
104
  * Metadata about the project