nx 19.7.2 → 19.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/package.json +12 -12
  2. package/schemas/nx-schema.json +2 -2
  3. package/src/command-line/add/add.js +2 -2
  4. package/src/command-line/affected/command-object.js +6 -6
  5. package/src/command-line/deprecated/command-objects.js +3 -3
  6. package/src/command-line/generate/generate.js +2 -1
  7. package/src/command-line/import/command-object.js +8 -6
  8. package/src/command-line/import/import.d.ts +1 -1
  9. package/src/command-line/import/import.js +45 -29
  10. package/src/command-line/import/utils/prepare-source-repo.js +7 -35
  11. package/src/command-line/init/init-v2.js +6 -2
  12. package/src/command-line/login/login.js +2 -2
  13. package/src/command-line/logout/logout.js +2 -2
  14. package/src/command-line/migrate/migrate.js +2 -2
  15. package/src/command-line/new/new.js +2 -1
  16. package/src/command-line/release/changelog.js +2 -2
  17. package/src/command-line/release/command-object.d.ts +2 -2
  18. package/src/command-line/release/config/config.js +10 -3
  19. package/src/command-line/release/plan-check.js +2 -2
  20. package/src/command-line/release/plan.js +2 -2
  21. package/src/command-line/release/publish.js +2 -2
  22. package/src/command-line/release/release.js +2 -2
  23. package/src/command-line/release/utils/git.d.ts +2 -2
  24. package/src/command-line/release/utils/git.js +12 -2
  25. package/src/command-line/release/utils/shared.d.ts +1 -1
  26. package/src/command-line/release/version.js +6 -1
  27. package/src/command-line/repair/repair.js +2 -2
  28. package/src/command-line/run/command-object.js +3 -3
  29. package/src/command-line/run/run.js +3 -2
  30. package/src/command-line/run-many/command-object.js +2 -2
  31. package/src/command-line/show/command-object.js +3 -3
  32. package/src/command-line/sync/sync.js +69 -11
  33. package/src/config/nx-json.d.ts +13 -5
  34. package/src/daemon/client/client.d.ts +3 -3
  35. package/src/daemon/server/handle-flush-sync-generator-changes-to-disk.js +2 -2
  36. package/src/daemon/server/handle-get-sync-generator-changes.js +8 -6
  37. package/src/daemon/server/sync-generators.d.ts +4 -4
  38. package/src/daemon/server/sync-generators.js +11 -2
  39. package/src/hasher/hash-task.js +2 -2
  40. package/src/native/nx.wasi-browser.js +42 -54
  41. package/src/native/nx.wasi.cjs +42 -54
  42. package/src/native/nx.wasm32-wasi.wasm +0 -0
  43. package/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +0 -1
  44. package/src/nx-cloud/utilities/get-cloud-options.d.ts +1 -0
  45. package/src/nx-cloud/utilities/get-cloud-options.js +4 -0
  46. package/src/nx-cloud/utilities/is-workspace-claimed.d.ts +1 -1
  47. package/src/nx-cloud/utilities/is-workspace-claimed.js +6 -5
  48. package/src/nx-cloud/utilities/onboarding.js +2 -2
  49. package/src/plugins/js/utils/register.js +7 -0
  50. package/src/project-graph/error-types.d.ts +1 -1
  51. package/src/project-graph/error-types.js +19 -5
  52. package/src/tasks-runner/cache.js +2 -1
  53. package/src/tasks-runner/run-command.js +142 -30
  54. package/src/tasks-runner/task-orchestrator.d.ts +0 -1
  55. package/src/tasks-runner/task-orchestrator.js +3 -6
  56. package/src/utils/git-utils.d.ts +3 -2
  57. package/src/utils/git-utils.index-filter.d.ts +0 -0
  58. package/src/utils/git-utils.index-filter.js +20 -0
  59. package/src/utils/git-utils.js +44 -13
  60. package/src/utils/git-utils.tree-filter.d.ts +11 -0
  61. package/src/utils/git-utils.tree-filter.js +43 -0
  62. package/src/utils/handle-errors.d.ts +1 -0
  63. package/src/utils/handle-errors.js +71 -0
  64. package/src/utils/nx-cloud-utils.d.ts +0 -1
  65. package/src/utils/nx-cloud-utils.js +0 -10
  66. package/src/utils/params.d.ts +0 -1
  67. package/src/utils/params.js +0 -50
  68. package/src/utils/plugins/plugin-capabilities.js +4 -1
  69. package/src/utils/sync-generators.d.ts +35 -6
  70. package/src/utils/sync-generators.js +144 -47
@@ -51,63 +51,51 @@ const {
51
51
  })
52
52
 
53
53
  function __napi_rs_initialize_modules(__napiInstance) {
54
- __napiInstance.exports['__napi_register__CachedResult_struct_0']?.()
55
- __napiInstance.exports['__napi_register__NxCache_struct_1']?.()
56
- __napiInstance.exports['__napi_register__NxCache_impl_9']?.()
57
- __napiInstance.exports['__napi_register__expand_outputs_10']?.()
58
- __napiInstance.exports['__napi_register__get_files_for_outputs_11']?.()
59
- __napiInstance.exports['__napi_register__remove_12']?.()
60
- __napiInstance.exports['__napi_register__copy_13']?.()
61
- __napiInstance.exports['__napi_register__validate_outputs_14']?.()
62
- __napiInstance.exports['__napi_register__get_transformable_outputs_15']?.()
63
- __napiInstance.exports['__napi_register__hash_array_16']?.()
64
- __napiInstance.exports['__napi_register__hash_file_17']?.()
65
- __napiInstance.exports['__napi_register__IS_WASM_18']?.()
66
- __napiInstance.exports['__napi_register__get_binary_target_19']?.()
67
- __napiInstance.exports['__napi_register__ImportResult_struct_20']?.()
68
- __napiInstance.exports['__napi_register__find_imports_21']?.()
69
- __napiInstance.exports['__napi_register__transfer_project_graph_22']?.()
70
- __napiInstance.exports['__napi_register__ExternalNode_struct_23']?.()
71
- __napiInstance.exports['__napi_register__Target_struct_24']?.()
72
- __napiInstance.exports['__napi_register__Project_struct_25']?.()
73
- __napiInstance.exports['__napi_register__ProjectGraph_struct_26']?.()
74
- __napiInstance.exports['__napi_register__HashedTask_struct_27']?.()
75
- __napiInstance.exports['__napi_register__TaskDetails_struct_28']?.()
76
- __napiInstance.exports['__napi_register__TaskDetails_impl_31']?.()
77
- __napiInstance.exports['__napi_register__HashPlanner_struct_32']?.()
78
- __napiInstance.exports['__napi_register__HashPlanner_impl_36']?.()
79
- __napiInstance.exports['__napi_register__HashDetails_struct_37']?.()
80
- __napiInstance.exports['__napi_register__HasherOptions_struct_38']?.()
81
- __napiInstance.exports['__napi_register__TaskHasher_struct_39']?.()
82
- __napiInstance.exports['__napi_register__TaskHasher_impl_42']?.()
83
- __napiInstance.exports['__napi_register__TaskRun_struct_43']?.()
84
- __napiInstance.exports['__napi_register__NxTaskHistory_struct_44']?.()
85
- __napiInstance.exports['__napi_register__NxTaskHistory_impl_48']?.()
86
- __napiInstance.exports['__napi_register__Task_struct_49']?.()
87
- __napiInstance.exports['__napi_register__TaskTarget_struct_50']?.()
88
- __napiInstance.exports['__napi_register__TaskGraph_struct_51']?.()
89
- __napiInstance.exports['__napi_register__FileData_struct_52']?.()
90
- __napiInstance.exports['__napi_register__InputsInput_struct_53']?.()
91
- __napiInstance.exports['__napi_register__FileSetInput_struct_54']?.()
92
- __napiInstance.exports['__napi_register__RuntimeInput_struct_55']?.()
93
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_56']?.()
94
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_57']?.()
95
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_58']?.()
96
- __napiInstance.exports['__napi_register__NxJson_struct_59']?.()
97
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_60']?.()
98
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_69']?.()
99
- __napiInstance.exports['__napi_register__WorkspaceErrors_70']?.()
100
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_71']?.()
101
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_72']?.()
102
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_73']?.()
103
- __napiInstance.exports['__napi_register__FileMap_struct_74']?.()
104
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_75']?.()
54
+ __napiInstance.exports['__napi_register__expand_outputs_0']?.()
55
+ __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
56
+ __napiInstance.exports['__napi_register__remove_2']?.()
57
+ __napiInstance.exports['__napi_register__copy_3']?.()
58
+ __napiInstance.exports['__napi_register__validate_outputs_4']?.()
59
+ __napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
60
+ __napiInstance.exports['__napi_register__hash_array_6']?.()
61
+ __napiInstance.exports['__napi_register__hash_file_7']?.()
62
+ __napiInstance.exports['__napi_register__IS_WASM_8']?.()
63
+ __napiInstance.exports['__napi_register__get_binary_target_9']?.()
64
+ __napiInstance.exports['__napi_register__ImportResult_struct_10']?.()
65
+ __napiInstance.exports['__napi_register__find_imports_11']?.()
66
+ __napiInstance.exports['__napi_register__transfer_project_graph_12']?.()
67
+ __napiInstance.exports['__napi_register__ExternalNode_struct_13']?.()
68
+ __napiInstance.exports['__napi_register__Target_struct_14']?.()
69
+ __napiInstance.exports['__napi_register__Project_struct_15']?.()
70
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_16']?.()
71
+ __napiInstance.exports['__napi_register__HashPlanner_struct_17']?.()
72
+ __napiInstance.exports['__napi_register__HashPlanner_impl_21']?.()
73
+ __napiInstance.exports['__napi_register__HashDetails_struct_22']?.()
74
+ __napiInstance.exports['__napi_register__HasherOptions_struct_23']?.()
75
+ __napiInstance.exports['__napi_register__TaskHasher_struct_24']?.()
76
+ __napiInstance.exports['__napi_register__TaskHasher_impl_27']?.()
77
+ __napiInstance.exports['__napi_register__Task_struct_28']?.()
78
+ __napiInstance.exports['__napi_register__TaskTarget_struct_29']?.()
79
+ __napiInstance.exports['__napi_register__TaskGraph_struct_30']?.()
80
+ __napiInstance.exports['__napi_register__FileData_struct_31']?.()
81
+ __napiInstance.exports['__napi_register__InputsInput_struct_32']?.()
82
+ __napiInstance.exports['__napi_register__FileSetInput_struct_33']?.()
83
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_34']?.()
84
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_35']?.()
85
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_36']?.()
86
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_37']?.()
87
+ __napiInstance.exports['__napi_register__NxJson_struct_38']?.()
88
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_39']?.()
89
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_48']?.()
90
+ __napiInstance.exports['__napi_register__WorkspaceErrors_49']?.()
91
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_50']?.()
92
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_51']?.()
93
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_52']?.()
94
+ __napiInstance.exports['__napi_register__FileMap_struct_53']?.()
95
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_54']?.()
105
96
  }
106
97
  export const HashPlanner = __napiModule.exports.HashPlanner
107
98
  export const ImportResult = __napiModule.exports.ImportResult
108
- export const NxCache = __napiModule.exports.NxCache
109
- export const NxTaskHistory = __napiModule.exports.NxTaskHistory
110
- export const TaskDetails = __napiModule.exports.TaskDetails
111
99
  export const TaskHasher = __napiModule.exports.TaskHasher
112
100
  export const WorkspaceContext = __napiModule.exports.WorkspaceContext
113
101
  export const copy = __napiModule.exports.copy
@@ -82,63 +82,51 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
82
82
  })
83
83
 
84
84
  function __napi_rs_initialize_modules(__napiInstance) {
85
- __napiInstance.exports['__napi_register__CachedResult_struct_0']?.()
86
- __napiInstance.exports['__napi_register__NxCache_struct_1']?.()
87
- __napiInstance.exports['__napi_register__NxCache_impl_9']?.()
88
- __napiInstance.exports['__napi_register__expand_outputs_10']?.()
89
- __napiInstance.exports['__napi_register__get_files_for_outputs_11']?.()
90
- __napiInstance.exports['__napi_register__remove_12']?.()
91
- __napiInstance.exports['__napi_register__copy_13']?.()
92
- __napiInstance.exports['__napi_register__validate_outputs_14']?.()
93
- __napiInstance.exports['__napi_register__get_transformable_outputs_15']?.()
94
- __napiInstance.exports['__napi_register__hash_array_16']?.()
95
- __napiInstance.exports['__napi_register__hash_file_17']?.()
96
- __napiInstance.exports['__napi_register__IS_WASM_18']?.()
97
- __napiInstance.exports['__napi_register__get_binary_target_19']?.()
98
- __napiInstance.exports['__napi_register__ImportResult_struct_20']?.()
99
- __napiInstance.exports['__napi_register__find_imports_21']?.()
100
- __napiInstance.exports['__napi_register__transfer_project_graph_22']?.()
101
- __napiInstance.exports['__napi_register__ExternalNode_struct_23']?.()
102
- __napiInstance.exports['__napi_register__Target_struct_24']?.()
103
- __napiInstance.exports['__napi_register__Project_struct_25']?.()
104
- __napiInstance.exports['__napi_register__ProjectGraph_struct_26']?.()
105
- __napiInstance.exports['__napi_register__HashedTask_struct_27']?.()
106
- __napiInstance.exports['__napi_register__TaskDetails_struct_28']?.()
107
- __napiInstance.exports['__napi_register__TaskDetails_impl_31']?.()
108
- __napiInstance.exports['__napi_register__HashPlanner_struct_32']?.()
109
- __napiInstance.exports['__napi_register__HashPlanner_impl_36']?.()
110
- __napiInstance.exports['__napi_register__HashDetails_struct_37']?.()
111
- __napiInstance.exports['__napi_register__HasherOptions_struct_38']?.()
112
- __napiInstance.exports['__napi_register__TaskHasher_struct_39']?.()
113
- __napiInstance.exports['__napi_register__TaskHasher_impl_42']?.()
114
- __napiInstance.exports['__napi_register__TaskRun_struct_43']?.()
115
- __napiInstance.exports['__napi_register__NxTaskHistory_struct_44']?.()
116
- __napiInstance.exports['__napi_register__NxTaskHistory_impl_48']?.()
117
- __napiInstance.exports['__napi_register__Task_struct_49']?.()
118
- __napiInstance.exports['__napi_register__TaskTarget_struct_50']?.()
119
- __napiInstance.exports['__napi_register__TaskGraph_struct_51']?.()
120
- __napiInstance.exports['__napi_register__FileData_struct_52']?.()
121
- __napiInstance.exports['__napi_register__InputsInput_struct_53']?.()
122
- __napiInstance.exports['__napi_register__FileSetInput_struct_54']?.()
123
- __napiInstance.exports['__napi_register__RuntimeInput_struct_55']?.()
124
- __napiInstance.exports['__napi_register__EnvironmentInput_struct_56']?.()
125
- __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_57']?.()
126
- __napiInstance.exports['__napi_register__DepsOutputsInput_struct_58']?.()
127
- __napiInstance.exports['__napi_register__NxJson_struct_59']?.()
128
- __napiInstance.exports['__napi_register__WorkspaceContext_struct_60']?.()
129
- __napiInstance.exports['__napi_register__WorkspaceContext_impl_69']?.()
130
- __napiInstance.exports['__napi_register__WorkspaceErrors_70']?.()
131
- __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_71']?.()
132
- __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_72']?.()
133
- __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_73']?.()
134
- __napiInstance.exports['__napi_register__FileMap_struct_74']?.()
135
- __napiInstance.exports['__napi_register____test_only_transfer_file_map_75']?.()
85
+ __napiInstance.exports['__napi_register__expand_outputs_0']?.()
86
+ __napiInstance.exports['__napi_register__get_files_for_outputs_1']?.()
87
+ __napiInstance.exports['__napi_register__remove_2']?.()
88
+ __napiInstance.exports['__napi_register__copy_3']?.()
89
+ __napiInstance.exports['__napi_register__validate_outputs_4']?.()
90
+ __napiInstance.exports['__napi_register__get_transformable_outputs_5']?.()
91
+ __napiInstance.exports['__napi_register__hash_array_6']?.()
92
+ __napiInstance.exports['__napi_register__hash_file_7']?.()
93
+ __napiInstance.exports['__napi_register__IS_WASM_8']?.()
94
+ __napiInstance.exports['__napi_register__get_binary_target_9']?.()
95
+ __napiInstance.exports['__napi_register__ImportResult_struct_10']?.()
96
+ __napiInstance.exports['__napi_register__find_imports_11']?.()
97
+ __napiInstance.exports['__napi_register__transfer_project_graph_12']?.()
98
+ __napiInstance.exports['__napi_register__ExternalNode_struct_13']?.()
99
+ __napiInstance.exports['__napi_register__Target_struct_14']?.()
100
+ __napiInstance.exports['__napi_register__Project_struct_15']?.()
101
+ __napiInstance.exports['__napi_register__ProjectGraph_struct_16']?.()
102
+ __napiInstance.exports['__napi_register__HashPlanner_struct_17']?.()
103
+ __napiInstance.exports['__napi_register__HashPlanner_impl_21']?.()
104
+ __napiInstance.exports['__napi_register__HashDetails_struct_22']?.()
105
+ __napiInstance.exports['__napi_register__HasherOptions_struct_23']?.()
106
+ __napiInstance.exports['__napi_register__TaskHasher_struct_24']?.()
107
+ __napiInstance.exports['__napi_register__TaskHasher_impl_27']?.()
108
+ __napiInstance.exports['__napi_register__Task_struct_28']?.()
109
+ __napiInstance.exports['__napi_register__TaskTarget_struct_29']?.()
110
+ __napiInstance.exports['__napi_register__TaskGraph_struct_30']?.()
111
+ __napiInstance.exports['__napi_register__FileData_struct_31']?.()
112
+ __napiInstance.exports['__napi_register__InputsInput_struct_32']?.()
113
+ __napiInstance.exports['__napi_register__FileSetInput_struct_33']?.()
114
+ __napiInstance.exports['__napi_register__RuntimeInput_struct_34']?.()
115
+ __napiInstance.exports['__napi_register__EnvironmentInput_struct_35']?.()
116
+ __napiInstance.exports['__napi_register__ExternalDependenciesInput_struct_36']?.()
117
+ __napiInstance.exports['__napi_register__DepsOutputsInput_struct_37']?.()
118
+ __napiInstance.exports['__napi_register__NxJson_struct_38']?.()
119
+ __napiInstance.exports['__napi_register__WorkspaceContext_struct_39']?.()
120
+ __napiInstance.exports['__napi_register__WorkspaceContext_impl_48']?.()
121
+ __napiInstance.exports['__napi_register__WorkspaceErrors_49']?.()
122
+ __napiInstance.exports['__napi_register__NxWorkspaceFiles_struct_50']?.()
123
+ __napiInstance.exports['__napi_register__NxWorkspaceFilesExternals_struct_51']?.()
124
+ __napiInstance.exports['__napi_register__UpdatedWorkspaceFiles_struct_52']?.()
125
+ __napiInstance.exports['__napi_register__FileMap_struct_53']?.()
126
+ __napiInstance.exports['__napi_register____test_only_transfer_file_map_54']?.()
136
127
  }
137
128
  module.exports.HashPlanner = __napiModule.exports.HashPlanner
138
129
  module.exports.ImportResult = __napiModule.exports.ImportResult
139
- module.exports.NxCache = __napiModule.exports.NxCache
140
- module.exports.NxTaskHistory = __napiModule.exports.NxTaskHistory
141
- module.exports.TaskDetails = __napiModule.exports.TaskDetails
142
130
  module.exports.TaskHasher = __napiModule.exports.TaskHasher
143
131
  module.exports.WorkspaceContext = __napiModule.exports.WorkspaceContext
144
132
  module.exports.copy = __napiModule.exports.copy
Binary file
@@ -89,7 +89,6 @@ async function connectToNxCloud(tree, schema, nxJson = (0, nx_json_1.readNxJson)
89
89
  return null;
90
90
  }
91
91
  const isGitHubDetected = schema.github ?? (await (0, url_shorten_1.repoUsesGithub)(schema.github));
92
- let responseFromCreateNxCloudWorkspaceV1;
93
92
  let responseFromCreateNxCloudWorkspaceV2;
94
93
  /**
95
94
  * Do not create an Nx Cloud token if the user is using GitHub and
@@ -2,3 +2,4 @@ import { CloudTaskRunnerOptions } from '../nx-cloud-tasks-runner-shell';
2
2
  export declare function getCloudOptions(directory?: string): CloudTaskRunnerOptions;
3
3
  export declare function getCloudUrl(): string;
4
4
  export declare function removeTrailingSlash(apiUrl: string): string;
5
+ export declare function isNxCloudId(token: string): boolean;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCloudOptions = getCloudOptions;
4
4
  exports.getCloudUrl = getCloudUrl;
5
5
  exports.removeTrailingSlash = removeTrailingSlash;
6
+ exports.isNxCloudId = isNxCloudId;
6
7
  const nx_json_1 = require("../../config/nx-json");
7
8
  const run_command_1 = require("../../tasks-runner/run-command");
8
9
  const workspace_root_1 = require("../../utils/workspace-root");
@@ -17,3 +18,6 @@ function getCloudUrl() {
17
18
  function removeTrailingSlash(apiUrl) {
18
19
  return apiUrl[apiUrl.length - 1] === '/' ? apiUrl.slice(0, -1) : apiUrl;
19
20
  }
21
+ function isNxCloudId(token) {
22
+ return token.length === 24;
23
+ }
@@ -1 +1 @@
1
- export declare function isWorkspaceClaimed(nxCloudAccessToken: any): Promise<any>;
1
+ export declare function isWorkspaceClaimed(accessToken: string): Promise<any>;
@@ -2,14 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isWorkspaceClaimed = isWorkspaceClaimed;
4
4
  const get_cloud_options_1 = require("./get-cloud-options");
5
- async function isWorkspaceClaimed(nxCloudAccessToken) {
6
- if (!nxCloudAccessToken)
5
+ async function isWorkspaceClaimed(accessToken) {
6
+ if (!accessToken)
7
7
  return false;
8
8
  const apiUrl = (0, get_cloud_options_1.getCloudUrl)();
9
9
  try {
10
- const response = await require('axios').post(`${apiUrl}/nx-cloud/is-workspace-claimed`, {
11
- nxCloudAccessToken,
12
- });
10
+ const requestData = (0, get_cloud_options_1.isNxCloudId)(accessToken)
11
+ ? { nxCloudId: accessToken }
12
+ : { nxCloudAccessToken: accessToken };
13
+ const response = await require('axios').post(`${apiUrl}/nx-cloud/is-workspace-claimed`, requestData);
13
14
  if (response.data.message) {
14
15
  return false;
15
16
  }
@@ -23,6 +23,6 @@ async function getNxCloudAppOnBoardingUrl(token) {
23
23
  }
24
24
  function readNxCloudToken(tree) {
25
25
  const nxJson = (0, devkit_exports_1.readNxJson)(tree);
26
- const { accessToken } = (0, run_command_1.getRunnerOptions)('default', nxJson, {}, true);
27
- return accessToken;
26
+ const { accessToken, nxCloudId } = (0, run_command_1.getRunnerOptions)('default', nxJson, {}, true);
27
+ return accessToken || nxCloudId;
28
28
  }
@@ -63,6 +63,13 @@ function registerTsProject(path, configFilename) {
63
63
  // Based on limited testing, it doesn't seem to matter if we register it multiple times, but just in
64
64
  // case let's keep a flag to prevent it.
65
65
  if (!isTsEsmLoaderRegistered) {
66
+ // We need a way to ensure that `.ts` files are treated as ESM not CJS.
67
+ // Since there is no way to pass compilerOptions like we do with the programmatic API, we should default
68
+ // the environment variable that ts-node checks.
69
+ process.env.TS_NODE_COMPILER_OPTIONS ??= JSON.stringify({
70
+ moduleResolution: 'nodenext',
71
+ module: 'nodenext',
72
+ });
66
73
  const module = require('node:module');
67
74
  if (module.register && packageIsInstalled('ts-node/esm')) {
68
75
  const url = require('node:url');
@@ -18,7 +18,7 @@ export declare class ProjectGraphError extends Error {
18
18
  */
19
19
  getPartialProjectGraph(): ProjectGraph;
20
20
  getPartialSourcemaps(): ConfigurationSourceMaps;
21
- getErrors(): (AggregateCreateNodesError | MergeNodesError | CreateMetadataError | ProjectsWithNoNameError | MultipleProjectsWithSameNameError | ProcessDependenciesError | ProcessProjectGraphError | WorkspaceValidityError)[];
21
+ getErrors(): (AggregateCreateNodesError | MergeNodesError | ProjectsWithNoNameError | MultipleProjectsWithSameNameError | CreateMetadataError | ProcessDependenciesError | ProcessProjectGraphError | WorkspaceValidityError)[];
22
22
  }
23
23
  export declare class MultipleProjectsWithSameNameError extends Error {
24
24
  conflicts: Map<string, string[]>;
@@ -24,7 +24,7 @@ class ProjectGraphError extends Error {
24
24
  tslib_1.__classPrivateFieldSet(this, _ProjectGraphError_partialProjectGraph, partialProjectGraph, "f");
25
25
  tslib_1.__classPrivateFieldSet(this, _ProjectGraphError_partialSourceMaps, partialSourceMaps, "f");
26
26
  this.stack = `${this.message}\n ${errors
27
- .map((error) => error.stack.split('\n').join('\n '))
27
+ .map((error) => indentString(formatErrorStackAndCause(error), 2))
28
28
  .join('\n')}`;
29
29
  }
30
30
  /**
@@ -186,13 +186,13 @@ class MergeNodesError extends Error {
186
186
  this.name = this.constructor.name;
187
187
  this.file = file;
188
188
  this.pluginName = pluginName;
189
- this.stack = `${this.message}\n ${error.stack.split('\n').join('\n ')}`;
189
+ this.stack = `${this.message}\n${indentString(formatErrorStackAndCause(error), 2)}`;
190
190
  }
191
191
  }
192
192
  exports.MergeNodesError = MergeNodesError;
193
193
  class CreateMetadataError extends Error {
194
194
  constructor(error, plugin) {
195
- super(`The "${plugin}" plugin threw an error while creating metadata:`, {
195
+ super(`The "${plugin}" plugin threw an error while creating metadata: ${error.message}`, {
196
196
  cause: error,
197
197
  });
198
198
  this.error = error;
@@ -203,7 +203,7 @@ class CreateMetadataError extends Error {
203
203
  exports.CreateMetadataError = CreateMetadataError;
204
204
  class ProcessDependenciesError extends Error {
205
205
  constructor(pluginName, { cause }) {
206
- super(`The "${pluginName}" plugin threw an error while creating dependencies:`, {
206
+ super(`The "${pluginName}" plugin threw an error while creating dependencies: ${cause.message}`, {
207
207
  cause,
208
208
  });
209
209
  this.pluginName = pluginName;
@@ -234,7 +234,7 @@ class ProcessProjectGraphError extends Error {
234
234
  });
235
235
  this.pluginName = pluginName;
236
236
  this.name = this.constructor.name;
237
- this.stack = `${this.message}\n ${cause.stack.split('\n').join('\n ')}`;
237
+ this.stack = `${this.message}\n${indentString(cause, 2)}`;
238
238
  }
239
239
  }
240
240
  exports.ProcessProjectGraphError = ProcessProjectGraphError;
@@ -289,3 +289,17 @@ class LoadPluginError extends Error {
289
289
  }
290
290
  }
291
291
  exports.LoadPluginError = LoadPluginError;
292
+ function indentString(str, indent) {
293
+ return (' '.repeat(indent) +
294
+ str
295
+ .split('\n')
296
+ .map((line) => ' '.repeat(indent) + line)
297
+ .join('\n'));
298
+ }
299
+ function formatErrorStackAndCause(error) {
300
+ const cause = error.cause && error.cause instanceof Error ? error.cause : null;
301
+ return (error.stack +
302
+ (cause
303
+ ? `\nCaused by: \n${indentString(cause.stack ?? cause.message, 2)}`
304
+ : ''));
305
+ }
@@ -17,7 +17,8 @@ const nx_json_1 = require("../config/nx-json");
17
17
  const update_manager_1 = require("../nx-cloud/update-manager");
18
18
  const get_cloud_options_1 = require("../nx-cloud/utilities/get-cloud-options");
19
19
  function getCache(options) {
20
- return process.env.NX_DB_CACHE === 'true'
20
+ return process.env.NX_DISABLE_DB !== 'true' &&
21
+ process.env.NX_DB_CACHE === 'true'
21
22
  ? new DbCache({
22
23
  // Remove this in Nx 21
23
24
  nxCloudRemoteCache: (0, nx_cloud_utils_1.isNxCloudUsed)((0, nx_json_1.readNxJson)())