nx 21.3.0-beta.6 → 21.3.0-canary.20250613-18155f4

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 (91) hide show
  1. package/bin/init-local.js +0 -6
  2. package/bin/nx.js +9 -5
  3. package/package.json +12 -12
  4. package/release/changelog-renderer/index.js +2 -10
  5. package/src/adapter/decorate-cli.js +1 -2
  6. package/src/adapter/ngcli-adapter.d.ts +0 -11
  7. package/src/adapter/ngcli-adapter.js +7 -101
  8. package/src/command-line/affected/affected.js +1 -1
  9. package/src/command-line/{nx-cloud/connect → connect}/command-object.js +4 -4
  10. package/src/command-line/{nx-cloud/connect → connect}/connect-to-nx-cloud.d.ts +4 -4
  11. package/src/command-line/{nx-cloud/connect → connect}/connect-to-nx-cloud.js +10 -10
  12. package/src/command-line/{nx-cloud/connect → connect}/view-logs.js +6 -6
  13. package/src/command-line/format/command-object.js +6 -12
  14. package/src/command-line/init/implementation/add-nx-to-monorepo.js +1 -1
  15. package/src/command-line/init/implementation/add-nx-to-nest.js +1 -1
  16. package/src/command-line/init/implementation/add-nx-to-npm-repo.js +1 -1
  17. package/src/command-line/init/implementation/angular/index.js +1 -1
  18. package/src/command-line/init/implementation/angular/legacy-angular-versions.js +1 -1
  19. package/src/command-line/init/implementation/utils.js +1 -1
  20. package/src/command-line/init/init-v2.js +1 -1
  21. package/src/command-line/{nx-cloud/login → login}/command-object.js +1 -1
  22. package/src/command-line/login/login.js +19 -0
  23. package/src/command-line/{nx-cloud/logout → logout}/command-object.js +1 -1
  24. package/src/command-line/{nx-cloud/utils.js → logout/logout.js} +4 -4
  25. package/src/command-line/migrate/migrate-ui-api.d.ts +3 -20
  26. package/src/command-line/migrate/migrate-ui-api.js +12 -115
  27. package/src/command-line/migrate/migrate.js +1 -1
  28. package/src/command-line/nx-commands.js +6 -12
  29. package/src/command-line/release/changelog.js +13 -3
  30. package/src/command-line/release/config/config.js +0 -12
  31. package/src/command-line/release/utils/git.d.ts +1 -1
  32. package/src/command-line/release/utils/git.js +10 -18
  33. package/src/command-line/release/utils/shared.js +1 -7
  34. package/src/command-line/release/version/release-group-processor.js +1 -1
  35. package/src/command-line/run/run-one.js +1 -1
  36. package/src/command-line/run-many/run-many.js +1 -1
  37. package/src/command-line/yargs-utils/shared-options.d.ts +0 -1
  38. package/src/command-line/yargs-utils/shared-options.js +0 -5
  39. package/src/config/nx-json.d.ts +0 -14
  40. package/src/core/graph/main.js +1 -1
  41. package/src/core/graph/styles.css +1 -1
  42. package/src/core/graph/styles.js +1 -1
  43. package/src/daemon/server/server.js +1 -7
  44. package/src/native/index.d.ts +1 -2
  45. package/src/native/nx.wasm32-wasi.wasm +0 -0
  46. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +1 -1
  47. package/src/plugins/js/lock-file/lock-file.d.ts +0 -1
  48. package/src/plugins/js/lock-file/lock-file.js +0 -2
  49. package/src/plugins/js/lock-file/npm-parser.js +3 -42
  50. package/src/plugins/js/lock-file/pnpm-parser.js +16 -43
  51. package/src/plugins/js/lock-file/project-graph-pruning.d.ts +1 -4
  52. package/src/plugins/js/lock-file/project-graph-pruning.js +5 -32
  53. package/src/plugins/js/lock-file/yarn-parser.js +7 -19
  54. package/src/plugins/package-json/create-nodes.js +1 -4
  55. package/src/tasks-runner/forked-process-task-runner.js +0 -4
  56. package/src/tasks-runner/is-tui-enabled.js +0 -8
  57. package/src/tasks-runner/run-command.js +1 -1
  58. package/src/tasks-runner/running-tasks/node-child-process.d.ts +0 -2
  59. package/src/tasks-runner/running-tasks/node-child-process.js +2 -16
  60. package/src/tasks-runner/task-orchestrator.js +1 -7
  61. package/src/utils/command-line-utils.d.ts +0 -1
  62. package/src/utils/package-json.js +1 -1
  63. package/src/utils/package-manager.d.ts +0 -1
  64. package/src/utils/package-manager.js +1 -10
  65. package/src/utils/project-graph-utils.d.ts +1 -6
  66. package/src/utils/project-graph-utils.js +6 -11
  67. package/src/utils/workspace-context.js +1 -1
  68. package/src/command-line/migrate/run-migration-process.js +0 -85
  69. package/src/command-line/nx-cloud/fix-ci/command-object.d.ts +0 -2
  70. package/src/command-line/nx-cloud/fix-ci/command-object.js +0 -12
  71. package/src/command-line/nx-cloud/fix-ci/fix-ci.d.ts +0 -4
  72. package/src/command-line/nx-cloud/fix-ci/fix-ci.js +0 -7
  73. package/src/command-line/nx-cloud/login/login.js +0 -10
  74. package/src/command-line/nx-cloud/logout/logout.js +0 -7
  75. package/src/command-line/nx-cloud/record/command-object.d.ts +0 -2
  76. package/src/command-line/nx-cloud/record/command-object.js +0 -12
  77. package/src/command-line/nx-cloud/record/record.d.ts +0 -4
  78. package/src/command-line/nx-cloud/record/record.js +0 -7
  79. package/src/command-line/nx-cloud/start-ci-run/command-object.d.ts +0 -2
  80. package/src/command-line/nx-cloud/start-ci-run/command-object.js +0 -12
  81. package/src/command-line/nx-cloud/start-ci-run/start-ci-run.d.ts +0 -4
  82. package/src/command-line/nx-cloud/start-ci-run/start-ci-run.js +0 -7
  83. package/src/command-line/nx-cloud/utils.d.ts +0 -1
  84. package/src/plugins/js/utils/get-workspace-packages-from-graph.d.ts +0 -2
  85. package/src/plugins/js/utils/get-workspace-packages-from-graph.js +0 -13
  86. /package/src/command-line/{nx-cloud/connect → connect}/command-object.d.ts +0 -0
  87. /package/src/command-line/{nx-cloud/connect → connect}/view-logs.d.ts +0 -0
  88. /package/src/command-line/{nx-cloud/login → login}/command-object.d.ts +0 -0
  89. /package/src/command-line/{nx-cloud/login → login}/login.d.ts +0 -0
  90. /package/src/command-line/{nx-cloud/logout → logout}/command-object.d.ts +0 -0
  91. /package/src/command-line/{nx-cloud/logout → logout}/logout.d.ts +0 -0
package/bin/init-local.js CHANGED
@@ -14,12 +14,6 @@ const nx_console_prompt_1 = require("../src/utils/nx-console-prompt");
14
14
  async function initLocal(workspace) {
15
15
  process.env.NX_CLI_SET = 'true';
16
16
  try {
17
- // In case Nx Cloud forcibly exits while the TUI is running, ensure the terminal is restored etc.
18
- process.on('exit', (...args) => {
19
- if (typeof globalThis.tuiOnProcessExit === 'function') {
20
- globalThis.tuiOnProcessExit(...args);
21
- }
22
- });
23
17
  perf_hooks_1.performance.mark('init-local');
24
18
  if (workspace.type !== 'nx' && shouldDelegateToAngularCLI()) {
25
19
  console.warn((0, strip_indents_1.stripIndents) `Using Nx to run Angular CLI commands is deprecated and will be removed in a future version.
package/bin/nx.js CHANGED
@@ -17,6 +17,12 @@ const perf_hooks_1 = require("perf_hooks");
17
17
  const workspace_context_1 = require("../src/utils/workspace-context");
18
18
  const client_1 = require("../src/daemon/client/client");
19
19
  const db_connection_1 = require("../src/utils/db-connection");
20
+ // In case Nx Cloud forcibly exits while the TUI is running, ensure the terminal is restored etc.
21
+ process.on('exit', (...args) => {
22
+ if (typeof globalThis.tuiOnProcessExit === 'function') {
23
+ globalThis.tuiOnProcessExit(...args);
24
+ }
25
+ });
20
26
  async function main() {
21
27
  if (process.argv[2] !== 'report' &&
22
28
  process.argv[2] !== '--version' &&
@@ -65,7 +71,7 @@ async function main() {
65
71
  handleNoWorkspace(GLOBAL_NX_VERSION);
66
72
  }
67
73
  if (!localNx) {
68
- handleMissingLocalInstallation(workspace ? workspace.dir : null);
74
+ handleMissingLocalInstallation();
69
75
  }
70
76
  // this file is already in the local workspace
71
77
  if (isLocalInstall) {
@@ -132,11 +138,9 @@ function resolveNx(workspace) {
132
138
  paths: [workspace ? workspace.dir : globalsRoot],
133
139
  });
134
140
  }
135
- function handleMissingLocalInstallation(detectedWorkspaceRoot) {
141
+ function handleMissingLocalInstallation() {
136
142
  output_1.output.error({
137
- title: detectedWorkspaceRoot
138
- ? `Could not find Nx modules at "${detectedWorkspaceRoot}".`
139
- : `Could not find Nx modules in this workspace.`,
143
+ title: `Could not find Nx modules in this workspace.`,
140
144
  bodyLines: [`Have you run ${chalk.bold.white(`npm/yarn install`)}?`],
141
145
  });
142
146
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "21.3.0-beta.6",
3
+ "version": "21.3.0-canary.20250613-18155f4",
4
4
  "private": false,
5
5
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
6
6
  "repository": {
@@ -50,7 +50,7 @@
50
50
  "flat": "^5.0.2",
51
51
  "front-matter": "^4.0.2",
52
52
  "ignore": "^5.0.4",
53
- "jest-diff": "^30.0.2",
53
+ "jest-diff": "^29.4.1",
54
54
  "jsonc-parser": "3.2.0",
55
55
  "lines-and-columns": "2.0.3",
56
56
  "minimatch": "9.0.3",
@@ -83,16 +83,16 @@
83
83
  }
84
84
  },
85
85
  "optionalDependencies": {
86
- "@nx/nx-darwin-arm64": "21.3.0-beta.6",
87
- "@nx/nx-darwin-x64": "21.3.0-beta.6",
88
- "@nx/nx-freebsd-x64": "21.3.0-beta.6",
89
- "@nx/nx-linux-arm-gnueabihf": "21.3.0-beta.6",
90
- "@nx/nx-linux-arm64-gnu": "21.3.0-beta.6",
91
- "@nx/nx-linux-arm64-musl": "21.3.0-beta.6",
92
- "@nx/nx-linux-x64-gnu": "21.3.0-beta.6",
93
- "@nx/nx-linux-x64-musl": "21.3.0-beta.6",
94
- "@nx/nx-win32-arm64-msvc": "21.3.0-beta.6",
95
- "@nx/nx-win32-x64-msvc": "21.3.0-beta.6"
86
+ "@nx/nx-darwin-arm64": "21.3.0-canary.20250613-18155f4",
87
+ "@nx/nx-darwin-x64": "21.3.0-canary.20250613-18155f4",
88
+ "@nx/nx-freebsd-x64": "21.3.0-canary.20250613-18155f4",
89
+ "@nx/nx-linux-arm-gnueabihf": "21.3.0-canary.20250613-18155f4",
90
+ "@nx/nx-linux-arm64-gnu": "21.3.0-canary.20250613-18155f4",
91
+ "@nx/nx-linux-arm64-musl": "21.3.0-canary.20250613-18155f4",
92
+ "@nx/nx-linux-x64-gnu": "21.3.0-canary.20250613-18155f4",
93
+ "@nx/nx-linux-x64-musl": "21.3.0-canary.20250613-18155f4",
94
+ "@nx/nx-win32-arm64-msvc": "21.3.0-canary.20250613-18155f4",
95
+ "@nx/nx-win32-x64-msvc": "21.3.0-canary.20250613-18155f4"
96
96
  },
97
97
  "nx-migrations": {
98
98
  "migrations": "./migrations.json",
@@ -132,16 +132,8 @@ class DefaultChangelogRenderer {
132
132
  return '';
133
133
  }
134
134
  renderVersionTitle() {
135
- let isMajorVersion = true;
136
- try {
137
- isMajorVersion =
138
- `${(0, semver_1.major)(this.changelogEntryVersion)}.0.0` ===
139
- this.changelogEntryVersion.replace(/^v/, '');
140
- }
141
- catch {
142
- // Do nothing with the error
143
- // Prevent non-semver versions from erroring out
144
- }
135
+ const isMajorVersion = `${(0, semver_1.major)(this.changelogEntryVersion)}.0.0` ===
136
+ this.changelogEntryVersion.replace(/^v/, '');
145
137
  let maybeDateStr = '';
146
138
  if (this.changelogRenderOptions.versionTitleDate) {
147
139
  const dateStr = new Date().toISOString().slice(0, 10);
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
- // TODO(v22): remove this file
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.decorateCli = decorateCli;
5
4
  const fs_1 = require("fs");
6
5
  const output_1 = require("../utils/output");
7
6
  function decorateCli() {
8
7
  output_1.output.warn({
9
- title: `Decoration of the Angular CLI is deprecated and will be removed in Nx v22`,
8
+ title: `Decoration of the Angular CLI is deprecated and will be removed in a future version`,
10
9
  bodyLines: [
11
10
  `Please replace usage of "ng <command>" in any scripts, particularly for CI, with "nx <command>"`,
12
11
  ],
@@ -87,15 +87,4 @@ export declare function wrapAngularDevkitSchematic(collectionName: string, gener
87
87
  [k: string]: any;
88
88
  }) => Promise<GeneratorCallback>;
89
89
  export declare const getLogger: (isVerbose?: boolean) => logging.Logger;
90
- /**
91
- * Restores Nx tokens in options when possible by comparing new and previous
92
- * options.
93
- * The function preserves tokens in the following cases:
94
- * 1. When the resolved previous value matches the new value exactly
95
- * 2. When the previous value used {workspaceRoot}
96
- * 3. When the previous value used {projectRoot} and the new value starts with
97
- * the project root path
98
- * Those are the only safe cases, for all other cases, the new value is used as-is.
99
- */
100
- export declare function restoreNxTokensInOptions<T extends Object | Array<unknown>>(newOptions: T, previousOptions: T, project: ProjectConfiguration): T;
101
90
  export {};
@@ -8,7 +8,6 @@ exports.generate = generate;
8
8
  exports.runMigration = runMigration;
9
9
  exports.mockSchematicsForTesting = mockSchematicsForTesting;
10
10
  exports.wrapAngularDevkitSchematic = wrapAngularDevkitSchematic;
11
- exports.restoreNxTokensInOptions = restoreNxTokensInOptions;
12
11
  const core_1 = require("@angular-devkit/core");
13
12
  const node_1 = require("@angular-devkit/core/node");
14
13
  const chalk = require("chalk");
@@ -29,7 +28,6 @@ const angular_json_1 = require("./angular-json");
29
28
  const executor_utils_1 = require("../command-line/run/executor-utils");
30
29
  const plugins_1 = require("../project-graph/plugins");
31
30
  const schema_utils_1 = require("../config/schema-utils");
32
- const project_configuration_utils_1 = require("../project-graph/utils/project-configuration-utils");
33
31
  async function createBuilderContext(builderInfo, context) {
34
32
  require('./compat');
35
33
  const fsHost = new NxScopedHostForBuilders(context.root);
@@ -298,32 +296,10 @@ class NxScopedHost extends core_1.virtualFs.ScopedHost {
298
296
  const projects = configV2.projects;
299
297
  const allObservables = [];
300
298
  Object.keys(projects).forEach((projectName) => {
301
- if (!projectsInAngularJson.includes(projectName)) {
302
- // Restore tokens in options if they were present before
303
- const previousProject = existingConfig.projects[projectName];
304
- const newProject = projects[projectName];
305
- if (previousProject &&
306
- newProject.targets &&
307
- previousProject.targets) {
308
- for (const [targetName, target] of Object.entries(newProject.targets)) {
309
- const previousTarget = previousProject.targets[targetName];
310
- if (target.options &&
311
- previousTarget &&
312
- previousTarget.options) {
313
- target.options = restoreNxTokensInOptions(target.options, previousTarget.options, newProject);
314
- }
315
- if (target.configurations &&
316
- previousTarget &&
317
- previousTarget.configurations) {
318
- for (const [configName, config] of Object.entries(target.configurations)) {
319
- if (previousTarget.configurations[configName]) {
320
- target.configurations[configName] =
321
- restoreNxTokensInOptions(config, previousTarget.configurations[configName], newProject);
322
- }
323
- }
324
- }
325
- }
326
- }
299
+ if (projectsInAngularJson.includes(projectName)) {
300
+ // ignore updates to angular.json
301
+ }
302
+ else {
327
303
  (0, project_configuration_1.updateProjectConfiguration)({
328
304
  root,
329
305
  exists: () => true,
@@ -454,23 +430,9 @@ class NxScopeHostUsedForWrappedSchematics extends NxScopedHost {
454
430
  read(path) {
455
431
  if ((path === 'angular.json' || path === '/angular.json') &&
456
432
  (0, angular_json_1.isAngularPluginInstalled)()) {
457
- // Replace the Nx-specific tokens in all target options
458
- const projects = Object.fromEntries((0, project_configuration_1.getProjects)(this.host));
459
- for (const [projectName, project] of Object.entries(projects)) {
460
- if (project.targets) {
461
- for (const [targetName, target] of Object.entries(project.targets)) {
462
- if (target.options) {
463
- target.options = (0, project_configuration_utils_1.resolveNxTokensInOptions)(target.options, { ...project, name: projectName }, `${projectName}:${targetName}`);
464
- }
465
- if (target.configurations) {
466
- for (const [configName, config] of Object.entries(target.configurations)) {
467
- target.configurations[configName] = (0, project_configuration_utils_1.resolveNxTokensInOptions)(config, { ...project, name: projectName }, `${projectName}:${targetName}:${configName}`);
468
- }
469
- }
470
- }
471
- }
472
- }
473
- const projectJsonConfig = (0, angular_json_1.toOldFormat)({ projects });
433
+ const projectJsonConfig = (0, angular_json_1.toOldFormat)({
434
+ projects: Object.fromEntries((0, project_configuration_1.getProjects)(this.host)),
435
+ });
474
436
  return super.readExistingAngularJson().pipe((0, operators_1.map)((angularJson) => {
475
437
  if (angularJson) {
476
438
  return Buffer.from(JSON.stringify({
@@ -890,59 +852,3 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
890
852
  }
891
853
  return new WrappedWorkspaceNodeModulesArchitectHost(workspace, root, projects);
892
854
  }
893
- /**
894
- * Restores Nx tokens in options when possible by comparing new and previous
895
- * options.
896
- * The function preserves tokens in the following cases:
897
- * 1. When the resolved previous value matches the new value exactly
898
- * 2. When the previous value used {workspaceRoot}
899
- * 3. When the previous value used {projectRoot} and the new value starts with
900
- * the project root path
901
- * Those are the only safe cases, for all other cases, the new value is used as-is.
902
- */
903
- function restoreNxTokensInOptions(newOptions, previousOptions, project) {
904
- if (!newOptions || !previousOptions) {
905
- return newOptions;
906
- }
907
- const result = Array.isArray(newOptions)
908
- ? [...newOptions]
909
- : { ...newOptions };
910
- const resolvedPreviousOptions = (0, project_configuration_utils_1.resolveNxTokensInOptions)(previousOptions, project, '');
911
- for (const key of Object.keys(newOptions)) {
912
- const newValue = newOptions[key];
913
- const previousValue = previousOptions[key];
914
- if (typeof newValue === 'string' && typeof previousValue === 'string') {
915
- if (resolvedPreviousOptions[key] === newValue) {
916
- // If the resolved previous value matches the new value, use the previous
917
- // value (potentially with tokens)
918
- result[key] = previousValue;
919
- }
920
- else if (previousValue.startsWith('{workspaceRoot}/')) {
921
- // If the previous value started with {workspaceRoot}, prefix the new
922
- // value with {workspaceRoot}
923
- result[key] = `{workspaceRoot}/${newValue.replace(/^\//, '')}`;
924
- }
925
- else if (previousValue.startsWith('{projectRoot}/') &&
926
- newValue.startsWith(`${project.root}/`)) {
927
- // If the previous value started with {projectRoot} and the new value
928
- // starts with the project root, replace the project root with the
929
- // {projectRoot} token
930
- result[key] = newValue.replace(`${project.root}/`, '{projectRoot}/');
931
- }
932
- else {
933
- // Otherwise, use the new value as-is
934
- result[key] = newValue;
935
- }
936
- }
937
- else if (typeof newValue === 'object' &&
938
- typeof previousValue === 'object' &&
939
- newValue &&
940
- previousValue) {
941
- result[key] = restoreNxTokensInOptions(newValue, previousValue, project);
942
- }
943
- else {
944
- result[key] = newValue;
945
- }
946
- }
947
- return result;
948
- }
@@ -5,7 +5,7 @@ exports.getAffectedGraphNodes = getAffectedGraphNodes;
5
5
  const file_utils_1 = require("../../project-graph/file-utils");
6
6
  const run_command_1 = require("../../tasks-runner/run-command");
7
7
  const output_1 = require("../../utils/output");
8
- const connect_to_nx_cloud_1 = require("../nx-cloud/connect/connect-to-nx-cloud");
8
+ const connect_to_nx_cloud_1 = require("../connect/connect-to-nx-cloud");
9
9
  const command_line_utils_1 = require("../../utils/command-line-utils");
10
10
  const perf_hooks_1 = require("perf_hooks");
11
11
  const project_graph_1 = require("../../project-graph/project-graph");
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsViewLogsCommand = exports.yargsConnectCommand = void 0;
4
- const documentation_1 = require("../../yargs-utils/documentation");
5
- const versions_1 = require("../../../utils/versions");
6
- const shared_options_1 = require("../../yargs-utils/shared-options");
4
+ const documentation_1 = require("../yargs-utils/documentation");
5
+ const versions_1 = require("../../utils/versions");
6
+ const shared_options_1 = require("../yargs-utils/shared-options");
7
7
  exports.yargsConnectCommand = {
8
8
  command: 'connect',
9
9
  aliases: ['connect-to-nx-cloud'],
@@ -11,7 +11,7 @@ exports.yargsConnectCommand = {
11
11
  builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)(withConnectOptions(yargs), 'connect-to-nx-cloud'),
12
12
  handler: async (args) => {
13
13
  await (await Promise.resolve().then(() => require('./connect-to-nx-cloud'))).connectToNxCloudCommand(args);
14
- await (await Promise.resolve().then(() => require('../../../utils/ab-testing'))).recordStat({
14
+ await (await Promise.resolve().then(() => require('../../utils/ab-testing'))).recordStat({
15
15
  command: 'connect',
16
16
  nxVersion: versions_1.nxVersion,
17
17
  useCloud: true,
@@ -1,7 +1,7 @@
1
- import { ConnectToNxCloudOptions } from '../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud';
2
- import { NxJsonConfiguration } from '../../../config/nx-json';
3
- import { NxArgs } from '../../../utils/command-line-utils';
4
- import { MessageKey } from '../../../utils/ab-testing';
1
+ import { ConnectToNxCloudOptions } from '../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud';
2
+ import { NxJsonConfiguration } from '../../config/nx-json';
3
+ import { NxArgs } from '../../utils/command-line-utils';
4
+ import { MessageKey } from '../../utils/ab-testing';
5
5
  export declare function onlyDefaultRunnerIsUsed(nxJson: NxJsonConfiguration): boolean;
6
6
  export declare function connectToNxCloudIfExplicitlyAsked(opts: NxArgs): Promise<void>;
7
7
  export declare function connectWorkspaceToCloud(options: ConnectToNxCloudOptions, directory?: string): Promise<string>;
@@ -6,16 +6,16 @@ exports.connectWorkspaceToCloud = connectWorkspaceToCloud;
6
6
  exports.connectToNxCloudCommand = connectToNxCloudCommand;
7
7
  exports.connectExistingRepoToNxCloudPrompt = connectExistingRepoToNxCloudPrompt;
8
8
  exports.connectToNxCloudWithPrompt = connectToNxCloudWithPrompt;
9
- const output_1 = require("../../../utils/output");
10
- const configuration_1 = require("../../../config/configuration");
11
- const tree_1 = require("../../../generators/tree");
12
- const connect_to_nx_cloud_1 = require("../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
13
- const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
14
- const nx_cloud_utils_1 = require("../../../utils/nx-cloud-utils");
15
- const child_process_1 = require("../../../utils/child-process");
16
- const ab_testing_1 = require("../../../utils/ab-testing");
17
- const versions_1 = require("../../../utils/versions");
18
- const workspace_root_1 = require("../../../utils/workspace-root");
9
+ const output_1 = require("../../utils/output");
10
+ const configuration_1 = require("../../config/configuration");
11
+ const tree_1 = require("../../generators/tree");
12
+ const connect_to_nx_cloud_1 = require("../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
13
+ const url_shorten_1 = require("../../nx-cloud/utilities/url-shorten");
14
+ const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
15
+ const child_process_1 = require("../../utils/child-process");
16
+ const ab_testing_1 = require("../../utils/ab-testing");
17
+ const versions_1 = require("../../utils/versions");
18
+ const workspace_root_1 = require("../../utils/workspace-root");
19
19
  const chalk = require("chalk");
20
20
  const ora = require("ora");
21
21
  const open = require("open");
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.viewLogs = viewLogs;
4
- const package_manager_1 = require("../../../utils/package-manager");
4
+ const package_manager_1 = require("../../utils/package-manager");
5
5
  const child_process_1 = require("child_process");
6
- const nx_cloud_utils_1 = require("../../../utils/nx-cloud-utils");
7
- const output_1 = require("../../../utils/output");
8
- const nx_json_1 = require("../../../config/nx-json");
6
+ const nx_cloud_utils_1 = require("../../utils/nx-cloud-utils");
7
+ const output_1 = require("../../utils/output");
8
+ const nx_json_1 = require("../../config/nx-json");
9
9
  const connect_to_nx_cloud_1 = require("./connect-to-nx-cloud");
10
- const connect_to_nx_cloud_2 = require("../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
11
- const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
10
+ const connect_to_nx_cloud_2 = require("../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
11
+ const url_shorten_1 = require("../../nx-cloud/utilities/url-shorten");
12
12
  async function viewLogs() {
13
13
  const cloudUsed = (0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)());
14
14
  if (cloudUsed) {
@@ -37,8 +37,13 @@ function withFormatOptions(yargs) {
37
37
  coerce: shared_options_1.parseCSV,
38
38
  })
39
39
  .option('sort-root-tsconfig-paths', {
40
- describe: `Ensure the workspace's tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost. The default value is "true" unless NX_FORMAT_SORT_TSCONFIG_PATHS is set to "false".`,
40
+ describe: `Ensure the workspace's tsconfig compilerOptions.paths are sorted. Warning: This will cause comments in the tsconfig to be lost.`,
41
41
  type: 'boolean',
42
+ /**
43
+ * TODO(v22): Stop sorting tsconfig paths by default, paths are now less common/important
44
+ * in Nx workspace setups, and the sorting causes comments to be lost.
45
+ */
46
+ default: true,
42
47
  })
43
48
  .option('all', {
44
49
  describe: 'Format all projects.',
@@ -46,16 +51,5 @@ function withFormatOptions(yargs) {
46
51
  })
47
52
  .conflicts({
48
53
  all: 'projects',
49
- })
50
- .middleware((args) => {
51
- /**
52
- * TODO(v22): Stop sorting tsconfig paths by default, paths are now less common/important
53
- * in Nx workspace setups, and the sorting causes comments to be lost.
54
- */
55
- args.sortRootTsconfigPaths ??=
56
- process.env.NX_FORMAT_SORT_TSCONFIG_PATHS !== 'false';
57
- // If NX_FORMAT_SORT_TSCONFIG_PATHS=false and --sort-root-tsconfig-paths is passed, we want to set it to true favoring the arg
58
- process.env.NX_FORMAT_SORT_TSCONFIG_PATHS =
59
- args.sortRootTsconfigPaths.toString();
60
54
  });
61
55
  }
@@ -8,7 +8,7 @@ const path_1 = require("path");
8
8
  const fileutils_1 = require("../../../utils/fileutils");
9
9
  const output_1 = require("../../../utils/output");
10
10
  const utils_1 = require("./utils");
11
- const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
11
+ const connect_to_nx_cloud_1 = require("../../connect/connect-to-nx-cloud");
12
12
  async function addNxToMonorepo(options) {
13
13
  const repoRoot = process.cwd();
14
14
  output_1.output.log({ title: '🐳 Nx initialization' });
@@ -9,7 +9,7 @@ const output_1 = require("../../../utils/output");
9
9
  const package_manager_1 = require("../../../utils/package-manager");
10
10
  const utils_1 = require("./utils");
11
11
  const versions_1 = require("../../../utils/versions");
12
- const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
12
+ const connect_to_nx_cloud_1 = require("../../connect/connect-to-nx-cloud");
13
13
  async function addNxToNest(options, packageJson) {
14
14
  const repoRoot = process.cwd();
15
15
  output_1.output.log({ title: '🐳 Nx initialization' });
@@ -7,7 +7,7 @@ const fileutils_1 = require("../../../utils/fileutils");
7
7
  const output_1 = require("../../../utils/output");
8
8
  const package_manager_1 = require("../../../utils/package-manager");
9
9
  const utils_1 = require("./utils");
10
- const connect_to_nx_cloud_1 = require("../../nx-cloud/connect/connect-to-nx-cloud");
10
+ const connect_to_nx_cloud_1 = require("../../connect/connect-to-nx-cloud");
11
11
  async function addNxToNpmRepo(options) {
12
12
  const repoRoot = process.cwd();
13
13
  output_1.output.log({ title: '🐳 Nx initialization' });
@@ -11,7 +11,7 @@ const utils_1 = require("../utils");
11
11
  const integrated_workspace_1 = require("./integrated-workspace");
12
12
  const legacy_angular_versions_1 = require("./legacy-angular-versions");
13
13
  const standalone_workspace_1 = require("./standalone-workspace");
14
- const connect_to_nx_cloud_1 = require("../../../nx-cloud/connect/connect-to-nx-cloud");
14
+ const connect_to_nx_cloud_1 = require("../../../connect/connect-to-nx-cloud");
15
15
  const defaultCacheableOperations = [
16
16
  'build',
17
17
  'server',
@@ -10,7 +10,7 @@ const object_sort_1 = require("../../../../utils/object-sort");
10
10
  const output_1 = require("../../../../utils/output");
11
11
  const package_json_1 = require("../../../../utils/package-json");
12
12
  const package_manager_1 = require("../../../../utils/package-manager");
13
- const connect_to_nx_cloud_1 = require("../../../nx-cloud/connect/connect-to-nx-cloud");
13
+ const connect_to_nx_cloud_1 = require("../../../connect/connect-to-nx-cloud");
14
14
  const utils_1 = require("../utils");
15
15
  // map of Angular major versions to Nx versions to use for legacy `nx init` migrations,
16
16
  // key is major Angular version and value is Nx version to use
@@ -22,7 +22,7 @@ const versions_1 = require("../../../utils/versions");
22
22
  const fs_1 = require("fs");
23
23
  const connect_to_nx_cloud_1 = require("../../../nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud");
24
24
  const url_shorten_1 = require("../../../nx-cloud/utilities/url-shorten");
25
- const connect_to_nx_cloud_2 = require("../../nx-cloud/connect/connect-to-nx-cloud");
25
+ const connect_to_nx_cloud_2 = require("../../connect/connect-to-nx-cloud");
26
26
  const deduce_default_base_1 = require("./deduce-default-base");
27
27
  const child_process_2 = require("../../../utils/child-process");
28
28
  function createNxJsonFile(repoRoot, topologicalTargets, cacheableOperations, scriptOutputs) {
@@ -12,7 +12,7 @@ const output_1 = require("../../utils/output");
12
12
  const package_manager_1 = require("../../utils/package-manager");
13
13
  const versions_1 = require("../../utils/versions");
14
14
  const workspace_context_1 = require("../../utils/workspace-context");
15
- const connect_to_nx_cloud_1 = require("../nx-cloud/connect/connect-to-nx-cloud");
15
+ const connect_to_nx_cloud_1 = require("../connect/connect-to-nx-cloud");
16
16
  const configure_plugins_1 = require("./configure-plugins");
17
17
  const add_nx_to_monorepo_1 = require("./implementation/add-nx-to-monorepo");
18
18
  const add_nx_to_npm_repo_1 = require("./implementation/add-nx-to-npm-repo");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsLoginCommand = void 0;
4
- const shared_options_1 = require("../../yargs-utils/shared-options");
4
+ const shared_options_1 = require("../../command-line/yargs-utils/shared-options");
5
5
  exports.yargsLoginCommand = {
6
6
  command: 'login [nxCloudUrl]',
7
7
  describe: 'Login to Nx Cloud. This command is an alias for [`nx-cloud login`](/ci/reference/nx-cloud-cli#npx-nxcloud-login).',
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loginHandler = loginHandler;
4
+ const update_manager_1 = require("../../nx-cloud/update-manager");
5
+ const get_cloud_options_1 = require("../../nx-cloud/utilities/get-cloud-options");
6
+ const handle_errors_1 = require("../../utils/handle-errors");
7
+ const resolution_helpers_1 = require("../../nx-cloud/resolution-helpers");
8
+ function loginHandler(args) {
9
+ if (args.nxCloudUrl) {
10
+ process.env.NX_CLOUD_API = args.nxCloudUrl;
11
+ }
12
+ return (0, handle_errors_1.handleErrors)(args.verbose, async () => {
13
+ const nxCloudClient = (await (0, update_manager_1.verifyOrUpdateNxCloudClient)((0, get_cloud_options_1.getCloudOptions)()))
14
+ .nxCloudClient;
15
+ const paths = (0, resolution_helpers_1.findAncestorNodeModules)(__dirname, []);
16
+ nxCloudClient.configureLightClientRequire()(paths);
17
+ await nxCloudClient.commands.login();
18
+ });
19
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.yargsLogoutCommand = void 0;
4
- const shared_options_1 = require("../../yargs-utils/shared-options");
4
+ const shared_options_1 = require("../../command-line/yargs-utils/shared-options");
5
5
  exports.yargsLogoutCommand = {
6
6
  command: 'logout',
7
7
  describe: 'Logout from Nx Cloud. This command is an alias for [`nx-cloud logout`](/ci/reference/nx-cloud-cli#npx-nxcloud-logout).',
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.executeNxCloudCommand = executeNxCloudCommand;
3
+ exports.logoutHandler = logoutHandler;
4
4
  const update_manager_1 = require("../../nx-cloud/update-manager");
5
5
  const get_cloud_options_1 = require("../../nx-cloud/utilities/get-cloud-options");
6
6
  const handle_errors_1 = require("../../utils/handle-errors");
7
7
  const resolution_helpers_1 = require("../../nx-cloud/resolution-helpers");
8
- async function executeNxCloudCommand(commandName, verbose) {
9
- return (0, handle_errors_1.handleErrors)(verbose, async () => {
8
+ function logoutHandler(args) {
9
+ return (0, handle_errors_1.handleErrors)(args.verbose, async () => {
10
10
  const nxCloudClient = (await (0, update_manager_1.verifyOrUpdateNxCloudClient)((0, get_cloud_options_1.getCloudOptions)()))
11
11
  .nxCloudClient;
12
12
  const paths = (0, resolution_helpers_1.findAncestorNodeModules)(__dirname, []);
13
13
  nxCloudClient.configureLightClientRequire()(paths);
14
- await nxCloudClient.commands[commandName]();
14
+ await nxCloudClient.commands.logout();
15
15
  });
16
16
  }
@@ -1,7 +1,7 @@
1
1
  import type { MigrationDetailsWithId } from '../../config/misc-interfaces';
2
2
  import type { FileChange } from '../../generators/tree';
3
3
  export type MigrationsJsonMetadata = {
4
- completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration | StoppedMigration>;
4
+ completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration>;
5
5
  runningMigrations?: string[];
6
6
  initialGitRef?: {
7
7
  ref: string;
@@ -25,11 +25,6 @@ export type FailedMigration = {
25
25
  export type SkippedMigration = {
26
26
  type: 'skipped';
27
27
  };
28
- export type StoppedMigration = {
29
- type: 'stopped';
30
- name: string;
31
- error: string;
32
- };
33
28
  export declare function recordInitialMigrationMetadata(workspacePath: string, versionToMigrateTo: string): void;
34
29
  export declare function finishMigrationProcess(workspacePath: string, squashCommits: boolean, commitMessage: string): void;
35
30
  export declare function runSingleMigration(workspacePath: string, migration: MigrationDetailsWithId, configuration: {
@@ -41,7 +36,7 @@ export declare function modifyMigrationsJsonMetadata(workspacePath: string, modi
41
36
  export declare function addSuccessfulMigration(id: string, fileChanges: Omit<FileChange, 'content'>[], ref: string, nextSteps: string[]): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;
42
37
  export declare function updateRefForSuccessfulMigration(id: string, ref: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;
43
38
  export declare function addFailedMigration(id: string, error: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => {
44
- completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration | StoppedMigration>;
39
+ completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration>;
45
40
  runningMigrations?: string[];
46
41
  initialGitRef?: {
47
42
  ref: string;
@@ -51,17 +46,7 @@ export declare function addFailedMigration(id: string, error: string): (migratio
51
46
  targetVersion?: string;
52
47
  };
53
48
  export declare function addSkippedMigration(id: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => {
54
- completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration | StoppedMigration>;
55
- runningMigrations?: string[];
56
- initialGitRef?: {
57
- ref: string;
58
- subject: string;
59
- };
60
- confirmedPackageUpdates?: boolean;
61
- targetVersion?: string;
62
- };
63
- export declare function addStoppedMigration(id: string, error: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => {
64
- completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration | StoppedMigration>;
49
+ completedMigrations?: Record<string, SuccessfulMigration | FailedMigration | SkippedMigration>;
65
50
  runningMigrations?: string[];
66
51
  initialGitRef?: {
67
52
  ref: string;
@@ -72,5 +57,3 @@ export declare function addStoppedMigration(id: string, error: string): (migrati
72
57
  };
73
58
  export declare function readMigrationsJsonMetadata(workspacePath: string): MigrationsJsonMetadata;
74
59
  export declare function undoMigration(workspacePath: string, id: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;
75
- export declare function killMigrationProcess(migrationId: string, workspacePath?: string): boolean;
76
- export declare function stopMigration(migrationId: string): (migrationsJsonMetadata: MigrationsJsonMetadata) => MigrationsJsonMetadata;