nx 20.1.0-canary.20241109-77d6704 → 20.1.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -18,7 +18,7 @@ export declare class ProjectGraphError extends Error {
18
18
  */
19
19
  getPartialProjectGraph(): ProjectGraph;
20
20
  getPartialSourcemaps(): ConfigurationSourceMaps;
21
- getErrors(): (AggregateCreateNodesError | MergeNodesError | ProjectsWithNoNameError | MultipleProjectsWithSameNameError | CreateMetadataError | ProcessDependenciesError | WorkspaceValidityError)[];
21
+ getErrors(): (AggregateCreateNodesError | MergeNodesError | ProjectsWithNoNameError | MultipleProjectsWithSameNameError | ProcessDependenciesError | CreateMetadataError | WorkspaceValidityError)[];
22
22
  }
23
23
  export declare class MultipleProjectsWithSameNameError extends Error {
24
24
  conflicts: Map<string, string[]>;
@@ -75,6 +75,10 @@ function detectAndSetInvalidProjectGlobValues(map, sourceName, desiredImplicitDe
75
75
  const projectName = implicit.startsWith('!')
76
76
  ? implicit.substring(1)
77
77
  : implicit;
78
+ // Do not error on cross-workspace implicit dependency references
79
+ if (projectName.startsWith('nx-cloud:')) {
80
+ return false;
81
+ }
78
82
  return !(projectConfigurations[projectName] ||
79
83
  (0, find_matching_projects_1.findMatchingProjects)([implicit], projects).length);
80
84
  });
@@ -48,9 +48,6 @@ export declare function splitArgsIntoNxArgsAndOverrides(args: {
48
48
  __overrides_unparsed__: string[];
49
49
  };
50
50
  };
51
- export declare function readParallelFromArgsAndEnv(args: {
52
- [k: string]: any;
53
- }): number;
54
51
  export declare function parseFiles(options: NxArgs): {
55
52
  files: string[];
56
53
  };
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOverrides = createOverrides;
4
4
  exports.getBaseRef = getBaseRef;
5
5
  exports.splitArgsIntoNxArgsAndOverrides = splitArgsIntoNxArgsAndOverrides;
6
- exports.readParallelFromArgsAndEnv = readParallelFromArgsAndEnv;
7
6
  exports.parseFiles = parseFiles;
8
7
  exports.getProjectRoots = getProjectRoots;
9
8
  exports.readGraphFileFromGraphArg = readGraphFileFromGraphArg;
@@ -12,6 +11,7 @@ const file_utils_1 = require("../project-graph/file-utils");
12
11
  const output_1 = require("./output");
13
12
  const child_process_1 = require("child_process");
14
13
  const workspace_root_1 = require("./workspace-root");
14
+ const shared_options_1 = require("../command-line/yargs-utils/shared-options");
15
15
  function createOverrides(__overrides_unparsed__ = []) {
16
16
  let overrides = yargsParser(__overrides_unparsed__, {
17
17
  configuration: {
@@ -116,27 +116,9 @@ function splitArgsIntoNxArgsAndOverrides(args, mode, options = { printWarnings:
116
116
  nxArgs.skipNxCache = process.env.NX_SKIP_NX_CACHE === 'true';
117
117
  }
118
118
  normalizeNxArgsRunner(nxArgs, nxJson, options);
119
- nxArgs['parallel'] = readParallelFromArgsAndEnv(args);
119
+ nxArgs['parallel'] = (0, shared_options_1.readParallelFromArgsAndEnv)(args);
120
120
  return { nxArgs, overrides };
121
121
  }
122
- function readParallelFromArgsAndEnv(args) {
123
- if (args['parallel'] === 'false' || args['parallel'] === false) {
124
- return 1;
125
- }
126
- else if (args['parallel'] === 'true' ||
127
- args['parallel'] === true ||
128
- args['parallel'] === '' ||
129
- // dont require passing --parallel if NX_PARALLEL is set, but allow overriding it
130
- (process.env.NX_PARALLEL && args['parallel'] === undefined)) {
131
- return Number(args['maxParallel'] ||
132
- args['max-parallel'] ||
133
- process.env.NX_PARALLEL ||
134
- 3);
135
- }
136
- else if (args['parallel'] !== undefined) {
137
- return Number(args['parallel']);
138
- }
139
- }
140
122
  function normalizeNxArgsRunner(nxArgs, nxJson, options) {
141
123
  if (!nxArgs.runner) {
142
124
  const envKey = 'NX_TASKS_RUNNER';
@@ -33,7 +33,8 @@ function findMatchingProjects(patterns = [], projects) {
33
33
  patterns.unshift('*');
34
34
  }
35
35
  for (const stringPattern of patterns) {
36
- if (!stringPattern.length) {
36
+ // Do not waste time attempting to look up cross-workspace references which will never match
37
+ if (!stringPattern.length || stringPattern.startsWith('nx-cloud:')) {
37
38
  continue;
38
39
  }
39
40
  const pattern = parseStringPattern(stringPattern, projects);
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleErrors = handleErrors;
4
- const client_1 = require("../daemon/client/client");
5
4
  const logger_1 = require("./logger");
6
5
  const output_1 = require("./output");
7
6
  async function handleErrors(isVerbose, fn) {
@@ -50,8 +49,9 @@ async function handleErrors(isVerbose, fn) {
50
49
  bodyLines,
51
50
  });
52
51
  }
53
- if (client_1.daemonClient.enabled()) {
54
- client_1.daemonClient.reset();
52
+ const { daemonClient } = await Promise.resolve().then(() => require('../daemon/client/client'));
53
+ if (daemonClient.enabled()) {
54
+ daemonClient.reset();
55
55
  }
56
56
  return 1;
57
57
  }