@openrewrite/rewrite 8.69.0-20251210-214835 → 8.69.0-20251211-085327

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 (50) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +2 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/javascript/node-resolution-result.d.ts +9 -0
  5. package/dist/javascript/node-resolution-result.d.ts.map +1 -1
  6. package/dist/javascript/node-resolution-result.js +10 -1
  7. package/dist/javascript/node-resolution-result.js.map +1 -1
  8. package/dist/javascript/package-manager.d.ts +76 -89
  9. package/dist/javascript/package-manager.d.ts.map +1 -1
  10. package/dist/javascript/package-manager.js +114 -139
  11. package/dist/javascript/package-manager.js.map +1 -1
  12. package/dist/javascript/recipes/add-dependency.d.ts +57 -0
  13. package/dist/javascript/recipes/add-dependency.d.ts.map +1 -0
  14. package/dist/javascript/recipes/add-dependency.js +404 -0
  15. package/dist/javascript/recipes/add-dependency.js.map +1 -0
  16. package/dist/javascript/recipes/index.d.ts +1 -0
  17. package/dist/javascript/recipes/index.d.ts.map +1 -1
  18. package/dist/javascript/recipes/index.js +1 -0
  19. package/dist/javascript/recipes/index.js.map +1 -1
  20. package/dist/javascript/recipes/upgrade-dependency-version.d.ts +3 -24
  21. package/dist/javascript/recipes/upgrade-dependency-version.d.ts.map +1 -1
  22. package/dist/javascript/recipes/upgrade-dependency-version.js +34 -157
  23. package/dist/javascript/recipes/upgrade-dependency-version.js.map +1 -1
  24. package/dist/javascript/recipes/upgrade-transitive-dependency-version.d.ts +2 -19
  25. package/dist/javascript/recipes/upgrade-transitive-dependency-version.d.ts.map +1 -1
  26. package/dist/javascript/recipes/upgrade-transitive-dependency-version.js +21 -137
  27. package/dist/javascript/recipes/upgrade-transitive-dependency-version.js.map +1 -1
  28. package/dist/javascript/search/find-dependency.d.ts.map +1 -1
  29. package/dist/javascript/search/find-dependency.js +8 -47
  30. package/dist/javascript/search/find-dependency.js.map +1 -1
  31. package/dist/json/tree.d.ts +30 -0
  32. package/dist/json/tree.d.ts.map +1 -1
  33. package/dist/json/tree.js +113 -0
  34. package/dist/json/tree.js.map +1 -1
  35. package/dist/parser.d.ts +9 -0
  36. package/dist/parser.d.ts.map +1 -1
  37. package/dist/parser.js +27 -0
  38. package/dist/parser.js.map +1 -1
  39. package/dist/version.txt +1 -1
  40. package/package.json +1 -1
  41. package/src/index.ts +2 -1
  42. package/src/javascript/node-resolution-result.ts +16 -0
  43. package/src/javascript/package-manager.ts +197 -174
  44. package/src/javascript/recipes/add-dependency.ts +467 -0
  45. package/src/javascript/recipes/index.ts +1 -0
  46. package/src/javascript/recipes/upgrade-dependency-version.ts +52 -199
  47. package/src/javascript/recipes/upgrade-transitive-dependency-version.ts +39 -165
  48. package/src/javascript/search/find-dependency.ts +13 -52
  49. package/src/json/tree.ts +98 -1
  50. package/src/parser.ts +17 -0
@@ -62,13 +62,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
62
62
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63
63
  });
64
64
  };
65
- var __asyncValues = (this && this.__asyncValues) || function (o) {
66
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
67
- var m = o[Symbol.asyncIterator], i;
68
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
69
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
70
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
71
- };
72
65
  Object.defineProperty(exports, "__esModule", { value: true });
73
66
  exports.UpgradeDependencyVersion = void 0;
74
67
  const recipe_1 = require("../../recipe");
@@ -101,13 +94,7 @@ class UpgradeDependencyVersion extends recipe_1.ScanningRecipe {
101
94
  this.description = "Upgrades the version of a direct dependency in `package.json` and updates the lock file by running the package manager.";
102
95
  }
103
96
  initialValue(_ctx) {
104
- return {
105
- projectsToUpdate: new Map(),
106
- updatedLockFiles: new Map(),
107
- updatedPackageJsons: new Map(),
108
- processedProjects: new Set(),
109
- failedProjects: new Map()
110
- };
97
+ return (0, package_manager_1.createDependencyRecipeAccumulator)();
111
98
  }
112
99
  /**
113
100
  * Determines if the dependency should be upgraded from currentVersion to newVersion.
@@ -157,7 +144,7 @@ class UpgradeDependencyVersion extends recipe_1.ScanningRecipe {
157
144
  const projectDir = path.dirname(path.resolve(doc.sourcePath));
158
145
  const pm = (_a = marker.packageManager) !== null && _a !== void 0 ? _a : node_resolution_result_1.PackageManager.Npm;
159
146
  // Check each dependency scope for the target package
160
- const scopes = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
147
+ const scopes = node_resolution_result_1.allDependencyScopes;
161
148
  let foundScope;
162
149
  let currentVersion;
163
150
  for (const scope of scopes) {
@@ -215,14 +202,11 @@ class UpgradeDependencyVersion extends recipe_1.ScanningRecipe {
215
202
  if (!updateInfo) {
216
203
  return doc; // This package.json doesn't need updating
217
204
  }
218
- // Run package manager install if we haven't processed this project yet
205
+ // Run package manager install if needed, check for failure
219
206
  // Skip if the resolved version already satisfies the new constraint
220
- if (!updateInfo.skipInstall && !acc.processedProjects.has(sourcePath)) {
221
- yield recipe.runPackageManagerInstall(acc, updateInfo, ctx);
222
- acc.processedProjects.add(sourcePath);
223
- }
224
- // Check if the install failed - if so, don't update, just add warning
225
- const failureMessage = acc.failedProjects.get(sourcePath);
207
+ const failureMessage = updateInfo.skipInstall
208
+ ? undefined
209
+ : yield (0, package_manager_1.runInstallIfNeeded)(sourcePath, acc, () => recipe.runPackageManagerInstall(acc, updateInfo, ctx));
226
210
  if (failureMessage) {
227
211
  return (0, markers_1.markupWarn)(doc, `Failed to upgrade ${recipe.packageName} to ${recipe.newVersion}`, failureMessage);
228
212
  }
@@ -230,56 +214,23 @@ class UpgradeDependencyVersion extends recipe_1.ScanningRecipe {
230
214
  const visitor = new UpdateVersionVisitor(recipe.packageName, updateInfo.newVersion, updateInfo.dependencyScope);
231
215
  const modifiedDoc = yield visitor.visit(doc, undefined);
232
216
  // Update the NodeResolutionResult marker
233
- return recipe.updateMarker(modifiedDoc, updateInfo, acc);
217
+ if (updateInfo.skipInstall) {
218
+ // Just update the versionConstraint in the marker - resolved version is unchanged
219
+ return recipe.updateMarkerVersionConstraint(modifiedDoc, updateInfo);
220
+ }
221
+ return (0, package_manager_1.updateNodeResolutionMarker)(modifiedDoc, updateInfo, acc);
234
222
  }
235
223
  // Handle lock files for all package managers
236
- for (const lockFileName of (0, package_manager_1.getAllLockFileNames)()) {
237
- if (sourcePath.endsWith(lockFileName)) {
238
- // Find the corresponding package.json path
239
- const packageJsonPath = sourcePath.replace(lockFileName, 'package.json');
240
- const updateInfo = acc.projectsToUpdate.get(packageJsonPath);
241
- if (updateInfo && acc.updatedLockFiles.has(sourcePath)) {
242
- // Parse the updated lock file content and return it
243
- const updatedContent = acc.updatedLockFiles.get(sourcePath);
244
- return this.parseUpdatedLockFile(doc, updatedContent);
245
- }
246
- break;
247
- }
224
+ const updatedLockContent = (0, package_manager_1.getUpdatedLockFileContent)(sourcePath, acc);
225
+ if (updatedLockContent) {
226
+ return yield new json_1.JsonParser({}).parseOne({
227
+ text: updatedLockContent,
228
+ sourcePath: doc.sourcePath
229
+ });
248
230
  }
249
231
  return doc;
250
232
  });
251
233
  }
252
- /**
253
- * Parses updated lock file content and creates a new document.
254
- */
255
- parseUpdatedLockFile(originalDoc, updatedContent) {
256
- return __awaiter(this, void 0, void 0, function* () {
257
- var _a, e_1, _b, _c;
258
- // Parse the updated content using JsonParser
259
- const parser = new json_1.JsonParser({});
260
- const parsed = [];
261
- try {
262
- for (var _d = true, _e = __asyncValues(parser.parse({ text: updatedContent, sourcePath: originalDoc.sourcePath })), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
263
- _c = _f.value;
264
- _d = false;
265
- const sf = _c;
266
- parsed.push(sf);
267
- }
268
- }
269
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
270
- finally {
271
- try {
272
- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
273
- }
274
- finally { if (e_1) throw e_1.error; }
275
- }
276
- if (parsed.length > 0) {
277
- // Preserve the original source path and markers
278
- return Object.assign(Object.assign({}, parsed[0]), { sourcePath: originalDoc.sourcePath, markers: originalDoc.markers });
279
- }
280
- return originalDoc;
281
- });
282
- }
283
234
  };
284
235
  });
285
236
  }
@@ -292,20 +243,7 @@ class UpgradeDependencyVersion extends recipe_1.ScanningRecipe {
292
243
  // Create modified package.json with the new version constraint
293
244
  const modifiedPackageJson = this.createModifiedPackageJson(updateInfo.originalPackageJson, updateInfo.dependencyScope, updateInfo.newVersion);
294
245
  const result = yield (0, package_manager_1.runInstallInTempDir)(updateInfo.projectDir, updateInfo.packageManager, modifiedPackageJson);
295
- if (result.success) {
296
- // Store the modified package.json (we'll use our visitor for actual output)
297
- acc.updatedPackageJsons.set(updateInfo.packageJsonPath, modifiedPackageJson);
298
- // Store the updated lock file content
299
- if (result.lockFileContent) {
300
- const lockFileName = (0, package_manager_1.getLockFileName)(updateInfo.packageManager);
301
- const lockFilePath = updateInfo.packageJsonPath.replace('package.json', lockFileName);
302
- acc.updatedLockFiles.set(lockFilePath, result.lockFileContent);
303
- }
304
- }
305
- else {
306
- // Track the failure - don't update package.json, the version likely doesn't exist
307
- acc.failedProjects.set(updateInfo.packageJsonPath, result.error || 'Unknown error');
308
- }
246
+ (0, package_manager_1.storeInstallResult)(result, acc, updateInfo, modifiedPackageJson);
309
247
  });
310
248
  }
311
249
  /**
@@ -319,65 +257,20 @@ class UpgradeDependencyVersion extends recipe_1.ScanningRecipe {
319
257
  }
320
258
  return JSON.stringify(packageJson, null, 2);
321
259
  }
322
- /**
323
- * Updates the NodeResolutionResult marker with new dependency information.
324
- */
325
- updateMarker(doc, updateInfo, acc) {
326
- return __awaiter(this, void 0, void 0, function* () {
327
- const existingMarker = (0, node_resolution_result_1.findNodeResolutionResult)(doc);
328
- if (!existingMarker) {
329
- return doc;
330
- }
331
- // If we skipped install, just update the versionConstraint in the marker
332
- // The resolved version is already correct, we only changed the constraint
333
- if (updateInfo.skipInstall) {
334
- return this.updateMarkerVersionConstraint(doc, existingMarker, updateInfo);
335
- }
336
- // Parse the updated package.json and lock file to create new marker
337
- const updatedPackageJson = acc.updatedPackageJsons.get(updateInfo.packageJsonPath);
338
- const lockFileName = (0, package_manager_1.getLockFileName)(updateInfo.packageManager);
339
- const updatedLockFile = acc.updatedLockFiles.get(updateInfo.packageJsonPath.replace('package.json', lockFileName));
340
- let packageJsonContent;
341
- let lockContent;
342
- try {
343
- packageJsonContent = JSON.parse(updatedPackageJson || updateInfo.originalPackageJson);
344
- }
345
- catch (_a) {
346
- return doc; // Failed to parse, keep original marker
347
- }
348
- if (updatedLockFile) {
349
- try {
350
- lockContent = JSON.parse(updatedLockFile);
351
- }
352
- catch (_b) {
353
- // Continue without lock file content
354
- }
355
- }
356
- // Read npmrc configs from the project directory
357
- const npmrcConfigs = yield (0, node_resolution_result_1.readNpmrcConfigs)(updateInfo.projectDir);
358
- // Create new marker
359
- const newMarker = (0, node_resolution_result_1.createNodeResolutionResultMarker)(existingMarker.path, packageJsonContent, lockContent, existingMarker.workspacePackagePaths, existingMarker.packageManager, npmrcConfigs.length > 0 ? npmrcConfigs : undefined);
360
- // Replace the marker in the document
361
- return Object.assign(Object.assign({}, doc), { markers: (0, markers_1.replaceMarkerByKind)(doc.markers, newMarker) });
362
- });
363
- }
364
260
  /**
365
261
  * Updates just the versionConstraint in the marker for the target dependency.
366
262
  * Used when skipInstall is true - the resolved version is unchanged.
367
263
  */
368
- updateMarkerVersionConstraint(doc, existingMarker, updateInfo) {
369
- // Create updated dependency lists with the new versionConstraint
370
- const updateDeps = (deps) => {
371
- if (!deps)
372
- return deps;
373
- return deps.map(dep => {
374
- if (dep.name === this.packageName) {
375
- return Object.assign(Object.assign({}, dep), { versionConstraint: updateInfo.newVersion });
376
- }
377
- return dep;
378
- });
379
- };
380
- const newMarker = Object.assign(Object.assign({}, existingMarker), { [updateInfo.dependencyScope]: updateDeps(existingMarker[updateInfo.dependencyScope]) });
264
+ updateMarkerVersionConstraint(doc, updateInfo) {
265
+ const existingMarker = (0, node_resolution_result_1.findNodeResolutionResult)(doc);
266
+ if (!existingMarker) {
267
+ return doc;
268
+ }
269
+ // Update the versionConstraint for the target dependency
270
+ const deps = existingMarker[updateInfo.dependencyScope];
271
+ const updatedDeps = deps === null || deps === void 0 ? void 0 : deps.map(dep => dep.name === this.packageName
272
+ ? Object.assign(Object.assign({}, dep), { versionConstraint: updateInfo.newVersion }) : dep);
273
+ const newMarker = Object.assign(Object.assign({}, existingMarker), { [updateInfo.dependencyScope]: updatedDeps });
381
274
  return Object.assign(Object.assign({}, doc), { markers: (0, markers_1.replaceMarkerByKind)(doc.markers, newMarker) });
382
275
  }
383
276
  }
@@ -385,14 +278,14 @@ exports.UpgradeDependencyVersion = UpgradeDependencyVersion;
385
278
  __decorate([
386
279
  (0, recipe_1.Option)({
387
280
  displayName: "Package name",
388
- description: "The name of the npm package to upgrade (e.g., 'lodash', '@types/node')",
281
+ description: "The name of the npm package to upgrade (e.g., `lodash`, `@types/node`)",
389
282
  example: "lodash"
390
283
  })
391
284
  ], UpgradeDependencyVersion.prototype, "packageName", void 0);
392
285
  __decorate([
393
286
  (0, recipe_1.Option)({
394
- displayName: "New version",
395
- description: "The new version constraint to set (e.g., '^5.0.0', '~2.1.0', '3.0.0')",
287
+ displayName: "Version",
288
+ description: "The version constraint to set (e.g., `^5.0.0`, `~2.1.0`, `3.0.0`)",
396
289
  example: "^5.0.0"
397
290
  })
398
291
  ], UpgradeDependencyVersion.prototype, "newVersion", void 0);
@@ -413,7 +306,7 @@ class UpdateVersionVisitor extends json_1.JsonVisitor {
413
306
  });
414
307
  return __awaiter(this, void 0, void 0, function* () {
415
308
  // Check if we're entering the target scope
416
- const keyName = this.getMemberKeyName(member);
309
+ const keyName = (0, json_1.getMemberKeyName)(member);
417
310
  if (keyName === this.targetScope) {
418
311
  // We're entering the dependencies scope
419
312
  this.inTargetScope = true;
@@ -429,29 +322,13 @@ class UpdateVersionVisitor extends json_1.JsonVisitor {
429
322
  return _super.visitMember.call(this, member, p);
430
323
  });
431
324
  }
432
- getMemberKeyName(member) {
433
- const key = member.key.element;
434
- if (key.kind === json_1.Json.Kind.Literal) {
435
- // Remove quotes from string literal
436
- const source = key.source;
437
- if (source.startsWith('"') && source.endsWith('"')) {
438
- return source.slice(1, -1);
439
- }
440
- return source;
441
- }
442
- else if (key.kind === json_1.Json.Kind.Identifier) {
443
- return key.name;
444
- }
445
- return undefined;
446
- }
447
325
  updateVersion(member) {
448
326
  const value = member.value;
449
- if (value.kind !== json_1.Json.Kind.Literal) {
327
+ if (!(0, json_1.isLiteral)(value)) {
450
328
  return member; // Not a literal value, can't update
451
329
  }
452
- const literal = value;
453
330
  // Create new literal with updated version
454
- const newLiteral = Object.assign(Object.assign({}, literal), { source: `"${this.newVersion}"`, value: this.newVersion });
331
+ const newLiteral = Object.assign(Object.assign({}, value), { source: `"${this.newVersion}"`, value: this.newVersion });
455
332
  return Object.assign(Object.assign({}, member), { value: newLiteral });
456
333
  }
457
334
  }
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-dependency-version.js","sourceRoot":"","sources":["../../../src/javascript/recipes/upgrade-dependency-version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoD;AAGpD,qCAAyD;AACzD,sEAOmC;AACnC,2CAA6B;AAC7B,+CAAiC;AACjC,2CAA8D;AAC9D,uCAAyC;AACzC,wDAA6F;AAoD7F;;;;;;;;;;;;;GAaG;AACH,MAAa,wBAAyB,SAAQ,uBAA2B;IAAzE;;QACa,SAA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AC5C,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/B,CAAC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;aAAM,IAAI,GAAG,CAAC,IAAI,KAAK,WAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YAC3C,OAAQ,GAAuB,CAAC,IAAI,CAAC;QACzC,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAEO,aAAa,CAAC,MAAmB;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,IAAI,KAAK,CAAC,IAAI,KAAK,WAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,OAAO,MAAM,CAAC,CAAC,oCAAoC;QACvD,CAAC;QAED,MAAM,OAAO,GAAG,KAAqB,CAAC;QAEtC,0CAA0C;QAC1C,MAAM,UAAU,mCACT,OAAO,KACV,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,GAAG,EAC9B,KAAK,EAAE,IAAI,CAAC,UAAU,GACzB,CAAC;QAEF,uCACO,MAAM,KACT,KAAK,EAAE,UAAU,IACnB;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"upgrade-dependency-version.js","sourceRoot":"","sources":["../../../src/javascript/recipes/upgrade-dependency-version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoD;AAGpD,qCAAsF;AACtF,sEAKmC;AACnC,2CAA6B;AAC7B,+CAAiC;AACjC,2CAA8D;AAC9D,uCAAyC;AACzC,wDAQ4B;AA6B5B;;;;;;;;;;;;;GAaG;AACH,MAAa,wBAAyB,SAAQ,uBAA2B;IAAzE;;QACa,SAAI,GAAG,o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,MAAM,EAAE,CAAC,EAAE;QACxC,CAAC;KAAA;IAEO,aAAa,CAAC,MAAmB;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,IAAI,CAAC,IAAA,gBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACpB,OAAO,MAAM,CAAC,CAAC,oCAAoC;QACvD,CAAC;QAED,0CAA0C;QAC1C,MAAM,UAAU,mCACT,KAAK,KACR,MAAM,EAAE,IAAI,IAAI,CAAC,UAAU,GAAG,EAC9B,KAAK,EAAE,IAAI,CAAC,UAAU,GACzB,CAAC;QAEF,uCACO,MAAM,KACT,KAAK,EAAE,UAAU,IACnB;IACN,CAAC;CACJ"}
@@ -2,6 +2,7 @@ import { ScanningRecipe } from "../../recipe";
2
2
  import { ExecutionContext } from "../../execution";
3
3
  import { TreeVisitor } from "../../visitor";
4
4
  import { PackageManager } from "../node-resolution-result";
5
+ import { DependencyRecipeAccumulator } from "../package-manager";
5
6
  import { DependencyPathSegment } from "../dependency-manager";
6
7
  /**
7
8
  * Information about a project that needs updating
@@ -25,21 +26,7 @@ interface ProjectUpdateInfo {
25
26
  /** Parsed dependency path for scoped overrides (if specified) */
26
27
  dependencyPathSegments?: DependencyPathSegment[];
27
28
  }
28
- /**
29
- * Accumulator for tracking state across scanning and editing phases
30
- */
31
- interface Accumulator {
32
- /** Projects that need updating: packageJsonPath -> update info */
33
- projectsToUpdate: Map<string, ProjectUpdateInfo>;
34
- /** After running package manager, store the updated lock file content */
35
- updatedLockFiles: Map<string, string>;
36
- /** Updated package.json content (after npm install may have modified it) */
37
- updatedPackageJsons: Map<string, string>;
38
- /** Track which projects have been processed (npm install has run) */
39
- processedProjects: Set<string>;
40
- /** Track projects where npm install failed: packageJsonPath -> error message */
41
- failedProjects: Map<string, string>;
42
- }
29
+ type Accumulator = DependencyRecipeAccumulator<ProjectUpdateInfo>;
43
30
  /**
44
31
  * Upgrades the version of a transitive dependency by adding override entries to package.json.
45
32
  *
@@ -72,10 +59,6 @@ export declare class UpgradeTransitiveDependencyVersion extends ScanningRecipe<A
72
59
  * Creates a modified package.json with the override.
73
60
  */
74
61
  private createModifiedPackageJson;
75
- /**
76
- * Updates the NodeResolutionResult marker with new dependency information.
77
- */
78
- private updateMarker;
79
62
  }
80
63
  export {};
81
64
  //# sourceMappingURL=upgrade-transitive-dependency-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-transitive-dependency-version.d.ts","sourceRoot":"","sources":["../../../src/javascript/recipes/upgrade-transitive-dependency-version.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAS,cAAc,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAMH,cAAc,EAEjB,MAAM,2BAA2B,CAAC;AAMnC,OAAO,EAA6B,qBAAqB,EAAsB,MAAM,uBAAuB,CAAC;AAE7G;;GAEG;AACH,UAAU,iBAAiB;IACvB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,cAAc,EAAE,cAAc,CAAC;IAC/B;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACpD;AAED;;GAEG;AACH,UAAU,WAAW;IACjB,kEAAkE;IAClE,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAEjD,yEAAyE;IACzE,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC,4EAA4E;IAC5E,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC,qEAAqE;IACrE,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAE/B,gFAAgF;IAChF,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,kCAAmC,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC/E,QAAQ,CAAC,IAAI,mFAAmF;IAChG,QAAQ,CAAC,WAAW,+CAA+C;IACnE,QAAQ,CAAC,WAAW,uKAAuK;IAO3L,WAAW,EAAG,MAAM,CAAC;IAOrB,UAAU,EAAG,MAAM,CAAC;IAQpB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW;IAU3C,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IA4EtE,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAmInF;;OAEG;YACW,wBAAwB;IA+BtC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAiBjC;;OAEG;YACW,YAAY;CAkD7B"}
1
+ {"version":3,"file":"upgrade-transitive-dependency-version.d.ts","sourceRoot":"","sources":["../../../src/javascript/recipes/upgrade-transitive-dependency-version.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAS,cAAc,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAIH,cAAc,EACjB,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAEH,2BAA2B,EAM9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA6B,qBAAqB,EAAsB,MAAM,uBAAuB,CAAC;AAE7G;;GAEG;AACH,UAAU,iBAAiB;IACvB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,cAAc,EAAE,cAAc,CAAC;IAC/B;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACpD;AAED,KAAK,WAAW,GAAG,2BAA2B,CAAC,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,qBAAa,kCAAmC,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC/E,QAAQ,CAAC,IAAI,mFAAmF;IAChG,QAAQ,CAAC,WAAW,+CAA+C;IACnE,QAAQ,CAAC,WAAW,uKAAuK;IAO3L,WAAW,EAAG,MAAM,CAAC;IAOrB,UAAU,EAAG,MAAM,CAAC;IAQpB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW;IAI3C,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IA2EtE,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAyFnF;;OAEG;YACW,wBAAwB;IAoBtC;;OAEG;IACH,OAAO,CAAC,yBAAyB;CAiBpC"}
@@ -62,13 +62,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
62
62
  step((generator = generator.apply(thisArg, _arguments || [])).next());
63
63
  });
64
64
  };
65
- var __asyncValues = (this && this.__asyncValues) || function (o) {
66
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
67
- var m = o[Symbol.asyncIterator], i;
68
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
69
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
70
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
71
- };
72
65
  Object.defineProperty(exports, "__esModule", { value: true });
73
66
  exports.UpgradeTransitiveDependencyVersion = void 0;
74
67
  const recipe_1 = require("../../recipe");
@@ -102,13 +95,7 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
102
95
  this.description = "Upgrades the version of a transitive dependency by adding override/resolution entries to `package.json` and updates the lock file by running the package manager.";
103
96
  }
104
97
  initialValue(_ctx) {
105
- return {
106
- projectsToUpdate: new Map(),
107
- updatedLockFiles: new Map(),
108
- updatedPackageJsons: new Map(),
109
- processedProjects: new Set(),
110
- failedProjects: new Map()
111
- };
98
+ return (0, package_manager_1.createDependencyRecipeAccumulator)();
112
99
  }
113
100
  scanner(acc) {
114
101
  return __awaiter(this, void 0, void 0, function* () {
@@ -129,8 +116,7 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
129
116
  const projectDir = path.dirname(path.resolve(doc.sourcePath));
130
117
  const pm = (_a = marker.packageManager) !== null && _a !== void 0 ? _a : node_resolution_result_1.PackageManager.Npm;
131
118
  // Check if package is a direct dependency - if so, skip (use UpgradeDependencyVersion instead)
132
- const scopes = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
133
- for (const scope of scopes) {
119
+ for (const scope of node_resolution_result_1.allDependencyScopes) {
134
120
  const deps = marker[scope];
135
121
  if (deps === null || deps === void 0 ? void 0 : deps.find(d => d.name === recipe.packageName)) {
136
122
  // Package is a direct dependency, don't add override
@@ -188,34 +174,23 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
188
174
  if (!updateInfo) {
189
175
  return doc; // This package.json doesn't need updating
190
176
  }
191
- // Run package manager install if we haven't processed this project yet
192
- if (!acc.processedProjects.has(sourcePath)) {
193
- yield recipe.runPackageManagerInstall(acc, updateInfo, ctx);
194
- acc.processedProjects.add(sourcePath);
195
- }
196
- // Check if the install failed - if so, don't update, just add warning
197
- const failureMessage = acc.failedProjects.get(sourcePath);
177
+ // Run package manager install if needed, check for failure
178
+ const failureMessage = yield (0, package_manager_1.runInstallIfNeeded)(sourcePath, acc, () => recipe.runPackageManagerInstall(acc, updateInfo, ctx));
198
179
  if (failureMessage) {
199
180
  return (0, markers_1.markupWarn)(doc, `Failed to add override for ${recipe.packageName} to ${recipe.newVersion}`, failureMessage);
200
181
  }
201
182
  // Add override entries
202
183
  const modifiedDoc = yield this.addOverrideEntry(doc, updateInfo);
203
184
  // Update the NodeResolutionResult marker
204
- return recipe.updateMarker(modifiedDoc, updateInfo, acc);
185
+ return (0, package_manager_1.updateNodeResolutionMarker)(modifiedDoc, updateInfo, acc);
205
186
  }
206
187
  // Handle lock files for all package managers
207
- for (const lockFileName of (0, package_manager_1.getAllLockFileNames)()) {
208
- if (sourcePath.endsWith(lockFileName)) {
209
- // Find the corresponding package.json path
210
- const packageJsonPath = sourcePath.replace(lockFileName, 'package.json');
211
- const updateInfo = acc.projectsToUpdate.get(packageJsonPath);
212
- if (updateInfo && acc.updatedLockFiles.has(sourcePath)) {
213
- // Parse the updated lock file content and return it
214
- const updatedContent = acc.updatedLockFiles.get(sourcePath);
215
- return this.parseUpdatedLockFile(doc, updatedContent);
216
- }
217
- break;
218
- }
188
+ const updatedLockContent = (0, package_manager_1.getUpdatedLockFileContent)(sourcePath, acc);
189
+ if (updatedLockContent) {
190
+ return yield new json_1.JsonParser({}).parseOne({
191
+ text: updatedLockContent,
192
+ sourcePath: doc.sourcePath
193
+ });
219
194
  }
220
195
  return doc;
221
196
  });
@@ -225,14 +200,13 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
225
200
  */
226
201
  addOverrideEntry(doc, updateInfo) {
227
202
  return __awaiter(this, void 0, void 0, function* () {
228
- var _a, e_1, _b, _c;
229
203
  // Parse current package.json content
230
204
  const currentContent = yield print_1.TreePrinters.print(doc);
231
205
  let packageJson;
232
206
  try {
233
207
  packageJson = JSON.parse(currentContent);
234
208
  }
235
- catch (_d) {
209
+ catch (_a) {
236
210
  return doc; // Can't parse, return unchanged
237
211
  }
238
212
  // Apply override
@@ -242,56 +216,11 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
242
216
  const indent = indentMatch ? indentMatch[1].length : 2;
243
217
  const newContent = JSON.stringify(modifiedPackageJson, null, indent);
244
218
  // Re-parse with JsonParser to get proper AST
245
- const parser = new json_1.JsonParser({});
246
- const parsed = [];
247
- try {
248
- for (var _e = true, _f = __asyncValues(parser.parse({ text: newContent, sourcePath: doc.sourcePath })), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) {
249
- _c = _g.value;
250
- _e = false;
251
- const sf = _c;
252
- parsed.push(sf);
253
- }
254
- }
255
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
256
- finally {
257
- try {
258
- if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);
259
- }
260
- finally { if (e_1) throw e_1.error; }
261
- }
262
- if (parsed.length > 0) {
263
- return Object.assign(Object.assign({}, parsed[0]), { sourcePath: doc.sourcePath, markers: doc.markers });
264
- }
265
- return doc;
266
- });
267
- }
268
- /**
269
- * Parses updated lock file content and creates a new document.
270
- */
271
- parseUpdatedLockFile(originalDoc, updatedContent) {
272
- return __awaiter(this, void 0, void 0, function* () {
273
- var _a, e_2, _b, _c;
274
- const parser = new json_1.JsonParser({});
275
- const parsed = [];
276
- try {
277
- for (var _d = true, _e = __asyncValues(parser.parse({ text: updatedContent, sourcePath: originalDoc.sourcePath })), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {
278
- _c = _f.value;
279
- _d = false;
280
- const sf = _c;
281
- parsed.push(sf);
282
- }
283
- }
284
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
285
- finally {
286
- try {
287
- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);
288
- }
289
- finally { if (e_2) throw e_2.error; }
290
- }
291
- if (parsed.length > 0) {
292
- return Object.assign(Object.assign({}, parsed[0]), { sourcePath: originalDoc.sourcePath, markers: originalDoc.markers });
293
- }
294
- return originalDoc;
219
+ const parsed = yield new json_1.JsonParser({}).parseOne({
220
+ text: newContent,
221
+ sourcePath: doc.sourcePath
222
+ });
223
+ return Object.assign(Object.assign({}, parsed), { markers: doc.markers });
295
224
  });
296
225
  }
297
226
  };
@@ -305,18 +234,7 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
305
234
  // Create modified package.json with the override
306
235
  const modifiedPackageJson = this.createModifiedPackageJson(updateInfo.originalPackageJson, updateInfo);
307
236
  const result = yield (0, package_manager_1.runInstallInTempDir)(updateInfo.projectDir, updateInfo.packageManager, modifiedPackageJson);
308
- if (result.success) {
309
- acc.updatedPackageJsons.set(updateInfo.packageJsonPath, modifiedPackageJson);
310
- // Store the updated lock file content
311
- if (result.lockFileContent) {
312
- const lockFileName = (0, package_manager_1.getLockFileName)(updateInfo.packageManager);
313
- const lockFilePath = updateInfo.packageJsonPath.replace('package.json', lockFileName);
314
- acc.updatedLockFiles.set(lockFilePath, result.lockFileContent);
315
- }
316
- }
317
- else {
318
- acc.failedProjects.set(updateInfo.packageJsonPath, result.error || 'Unknown error');
319
- }
237
+ (0, package_manager_1.storeInstallResult)(result, acc, updateInfo, modifiedPackageJson);
320
238
  });
321
239
  }
322
240
  /**
@@ -327,53 +245,19 @@ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
327
245
  packageJson = (0, dependency_manager_1.applyOverrideToPackageJson)(packageJson, updateInfo.packageManager, this.packageName, updateInfo.newVersion, updateInfo.dependencyPathSegments);
328
246
  return JSON.stringify(packageJson, null, 2);
329
247
  }
330
- /**
331
- * Updates the NodeResolutionResult marker with new dependency information.
332
- */
333
- updateMarker(doc, updateInfo, acc) {
334
- return __awaiter(this, void 0, void 0, function* () {
335
- const existingMarker = (0, node_resolution_result_1.findNodeResolutionResult)(doc);
336
- if (!existingMarker) {
337
- return doc;
338
- }
339
- // Parse the updated package.json and lock file to create new marker
340
- const updatedPackageJson = acc.updatedPackageJsons.get(updateInfo.packageJsonPath);
341
- const lockFileName = (0, package_manager_1.getLockFileName)(updateInfo.packageManager);
342
- const updatedLockFile = acc.updatedLockFiles.get(updateInfo.packageJsonPath.replace('package.json', lockFileName));
343
- let packageJsonContent;
344
- let lockContent;
345
- try {
346
- packageJsonContent = JSON.parse(updatedPackageJson || updateInfo.originalPackageJson);
347
- }
348
- catch (_a) {
349
- return doc;
350
- }
351
- if (updatedLockFile) {
352
- try {
353
- lockContent = JSON.parse(updatedLockFile);
354
- }
355
- catch (_b) {
356
- // Continue without lock file content
357
- }
358
- }
359
- const npmrcConfigs = yield (0, node_resolution_result_1.readNpmrcConfigs)(updateInfo.projectDir);
360
- const newMarker = (0, node_resolution_result_1.createNodeResolutionResultMarker)(existingMarker.path, packageJsonContent, lockContent, existingMarker.workspacePackagePaths, existingMarker.packageManager, npmrcConfigs.length > 0 ? npmrcConfigs : undefined);
361
- return Object.assign(Object.assign({}, doc), { markers: (0, markers_1.replaceMarkerByKind)(doc.markers, newMarker) });
362
- });
363
- }
364
248
  }
365
249
  exports.UpgradeTransitiveDependencyVersion = UpgradeTransitiveDependencyVersion;
366
250
  __decorate([
367
251
  (0, recipe_1.Option)({
368
252
  displayName: "Package name",
369
- description: "The name of the npm package to upgrade (e.g., 'lodash', '@types/node')",
253
+ description: "The name of the npm package to upgrade (e.g., `lodash`, `@types/node`)",
370
254
  example: "lodash"
371
255
  })
372
256
  ], UpgradeTransitiveDependencyVersion.prototype, "packageName", void 0);
373
257
  __decorate([
374
258
  (0, recipe_1.Option)({
375
- displayName: "New version",
376
- description: "The new version constraint to set (e.g., '^5.0.0', '~2.1.0', '3.0.0')",
259
+ displayName: "Version",
260
+ description: "The version constraint to set (e.g., `^5.0.0`, `~2.1.0`, `3.0.0`)",
377
261
  example: "^5.0.0"
378
262
  })
379
263
  ], UpgradeTransitiveDependencyVersion.prototype, "newVersion", void 0);