nx 18.2.0-canary.20240319-55f31cf → 18.2.0-canary.20240321-2a4c57d

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.
@@ -267,7 +267,11 @@ function processEnv(color, cwd, env) {
267
267
  ...localEnv,
268
268
  ...env,
269
269
  };
270
- res.PATH = localEnv.PATH; // need to override PATH to make sure we are using the local node_modules
270
+ // need to override PATH to make sure we are using the local node_modules
271
+ if (localEnv.PATH)
272
+ res.PATH = localEnv.PATH; // UNIX-like
273
+ if (localEnv.Path)
274
+ res.Path = localEnv.Path; // Windows
271
275
  if (color) {
272
276
  res.FORCE_COLOR = `${color}`;
273
277
  }
@@ -1 +1 @@
1
- export declare const typescriptVersion = "~5.3.2";
1
+ export declare const typescriptVersion = "~5.4.2";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.typescriptVersion = void 0;
4
- exports.typescriptVersion = '~5.3.2';
4
+ exports.typescriptVersion = '~5.4.2';
@@ -32,17 +32,27 @@ skipCommandNormalization) {
32
32
  // a project.json in which case it was already updated above.
33
33
  const updatedProjectConfiguration = {
34
34
  ...matchingProject,
35
- ...project,
36
35
  };
37
- if (sourceMap) {
38
- for (const property in project) {
39
- sourceMap[`${property}`] = sourceInformation;
36
+ for (const k in project) {
37
+ if (![
38
+ 'tags',
39
+ 'implicitDependencies',
40
+ 'generators',
41
+ 'targets',
42
+ 'metadata',
43
+ 'namedInputs',
44
+ ].includes(k)) {
45
+ updatedProjectConfiguration[k] = project[k];
46
+ if (sourceMap) {
47
+ sourceMap[`${k}`] = sourceInformation;
48
+ }
40
49
  }
41
50
  }
42
51
  // The next blocks handle properties that should be themselves merged (e.g. targets, tags, and implicit dependencies)
43
52
  if (project.tags) {
44
53
  updatedProjectConfiguration.tags = Array.from(new Set((matchingProject.tags ?? []).concat(project.tags)));
45
54
  if (sourceMap) {
55
+ sourceMap['tags'] ??= sourceInformation;
46
56
  project.tags.forEach((tag) => {
47
57
  sourceMap[`tags.${tag}`] = sourceInformation;
48
58
  });
@@ -51,6 +61,7 @@ skipCommandNormalization) {
51
61
  if (project.implicitDependencies) {
52
62
  updatedProjectConfiguration.implicitDependencies = (matchingProject.implicitDependencies ?? []).concat(project.implicitDependencies);
53
63
  if (sourceMap) {
64
+ sourceMap['implicitDependencies'] ??= sourceInformation;
54
65
  project.implicitDependencies.forEach((implicitDependency) => {
55
66
  sourceMap[`implicitDependencies.${implicitDependency}`] =
56
67
  sourceInformation;
@@ -61,6 +72,7 @@ skipCommandNormalization) {
61
72
  // Start with generators config in new project.
62
73
  updatedProjectConfiguration.generators = { ...project.generators };
63
74
  if (sourceMap) {
75
+ sourceMap['generators'] ??= sourceInformation;
64
76
  for (const generator in project.generators) {
65
77
  sourceMap[`generators.${generator}`] = sourceInformation;
66
78
  for (const property in project.generators[generator]) {
@@ -85,6 +97,7 @@ skipCommandNormalization) {
85
97
  ...project.namedInputs,
86
98
  };
87
99
  if (sourceMap) {
100
+ sourceMap['namedInputs'] ??= sourceInformation;
88
101
  for (const namedInput in project.namedInputs) {
89
102
  sourceMap[`namedInputs.${namedInput}`] = sourceInformation;
90
103
  }
@@ -94,6 +107,9 @@ skipCommandNormalization) {
94
107
  // We merge the targets with special handling, so clear this back to the
95
108
  // targets as defined originally before merging.
96
109
  updatedProjectConfiguration.targets = matchingProject?.targets ?? {};
110
+ if (sourceMap) {
111
+ sourceMap['targets'] ??= sourceInformation;
112
+ }
97
113
  // For each target defined in the new config
98
114
  for (const targetName in project.targets) {
99
115
  // Always set source map info for the target, but don't overwrite info already there
@@ -117,6 +133,75 @@ skipCommandNormalization) {
117
133
  updatedProjectConfiguration.targets[targetName] = mergedTarget;
118
134
  }
119
135
  }
136
+ if (project.metadata) {
137
+ if (sourceMap) {
138
+ sourceMap['targets'] ??= sourceInformation;
139
+ }
140
+ for (const [metadataKey, value] of Object.entries({
141
+ ...project.metadata,
142
+ })) {
143
+ const existingValue = matchingProject.metadata?.[metadataKey];
144
+ if (Array.isArray(value) && Array.isArray(existingValue)) {
145
+ for (const item of [...value]) {
146
+ const newLength = updatedProjectConfiguration.metadata[metadataKey].push(item);
147
+ if (sourceMap) {
148
+ sourceMap[`metadata.${metadataKey}.${newLength - 1}`] =
149
+ sourceInformation;
150
+ }
151
+ }
152
+ }
153
+ else if (Array.isArray(value) && existingValue === undefined) {
154
+ updatedProjectConfiguration.metadata ??= {};
155
+ updatedProjectConfiguration.metadata[metadataKey] ??= value;
156
+ if (sourceMap) {
157
+ sourceMap[`metadata.${metadataKey}`] = sourceInformation;
158
+ }
159
+ for (let i = 0; i < value.length; i++) {
160
+ if (sourceMap) {
161
+ sourceMap[`metadata.${metadataKey}.${i}`] = sourceInformation;
162
+ }
163
+ }
164
+ }
165
+ else if (typeof value === 'object' &&
166
+ typeof existingValue === 'object') {
167
+ for (const key in value) {
168
+ const existingValue = matchingProject.metadata?.[metadataKey]?.[key];
169
+ if (Array.isArray(value[key]) && Array.isArray(existingValue)) {
170
+ for (const item of value[key]) {
171
+ const i = updatedProjectConfiguration.metadata[metadataKey][key].push(item);
172
+ if (sourceMap) {
173
+ sourceMap[`metadata.${metadataKey}.${key}.${i - 1}`] =
174
+ sourceInformation;
175
+ }
176
+ }
177
+ }
178
+ else {
179
+ updatedProjectConfiguration.metadata[metadataKey] = value;
180
+ if (sourceMap) {
181
+ sourceMap[`metadata.${metadataKey}`] = sourceInformation;
182
+ }
183
+ }
184
+ }
185
+ }
186
+ else {
187
+ updatedProjectConfiguration.metadata[metadataKey] = value;
188
+ if (sourceMap) {
189
+ sourceMap[`metadata.${metadataKey}`] = sourceInformation;
190
+ if (typeof value === 'object') {
191
+ for (const k in value) {
192
+ sourceMap[`metadata.${metadataKey}.${k}`] = sourceInformation;
193
+ if (Array.isArray(value[k])) {
194
+ for (let i = 0; i < value[k].length; i++) {
195
+ sourceMap[`metadata.${metadataKey}.${k}.${i}`] =
196
+ sourceInformation;
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
120
205
  projectRootMap.set(updatedProjectConfiguration.root, updatedProjectConfiguration);
121
206
  }
122
207
  exports.mergeProjectConfigurationIntoRootMap = mergeProjectConfigurationIntoRootMap;