@openrewrite/rewrite 8.69.0-20251210-164937 → 8.69.0-20251210-194227

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 (36) 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/dependency-manager.d.ts +31 -0
  5. package/dist/javascript/dependency-manager.d.ts.map +1 -0
  6. package/dist/javascript/dependency-manager.js +243 -0
  7. package/dist/javascript/dependency-manager.js.map +1 -0
  8. package/dist/javascript/index.d.ts +1 -0
  9. package/dist/javascript/index.d.ts.map +1 -1
  10. package/dist/javascript/index.js +1 -0
  11. package/dist/javascript/index.js.map +1 -1
  12. package/dist/javascript/package-manager.d.ts +43 -0
  13. package/dist/javascript/package-manager.d.ts.map +1 -1
  14. package/dist/javascript/package-manager.js +85 -0
  15. package/dist/javascript/package-manager.js.map +1 -1
  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 +6 -6
  21. package/dist/javascript/recipes/upgrade-dependency-version.d.ts.map +1 -1
  22. package/dist/javascript/recipes/upgrade-dependency-version.js +51 -86
  23. package/dist/javascript/recipes/upgrade-dependency-version.js.map +1 -1
  24. package/dist/javascript/recipes/upgrade-transitive-dependency-version.d.ts +81 -0
  25. package/dist/javascript/recipes/upgrade-transitive-dependency-version.d.ts.map +1 -0
  26. package/dist/javascript/recipes/upgrade-transitive-dependency-version.js +388 -0
  27. package/dist/javascript/recipes/upgrade-transitive-dependency-version.js.map +1 -0
  28. package/dist/version.txt +1 -1
  29. package/package.json +1 -1
  30. package/src/index.ts +2 -1
  31. package/src/javascript/dependency-manager.ts +292 -0
  32. package/src/javascript/index.ts +1 -0
  33. package/src/javascript/package-manager.ts +111 -0
  34. package/src/javascript/recipes/index.ts +1 -0
  35. package/src/javascript/recipes/upgrade-dependency-version.ts +67 -105
  36. package/src/javascript/recipes/upgrade-transitive-dependency-version.ts +445 -0
@@ -0,0 +1,388 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2025 the original author or authors.
4
+ * <p>
5
+ * Licensed under the Moderne Source Available License (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ * <p>
9
+ * https://docs.moderne.io/licensing/moderne-source-available-license
10
+ * <p>
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
34
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
35
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
37
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
38
+ };
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
57
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
58
+ return new (P || (P = Promise))(function (resolve, reject) {
59
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
60
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
61
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
62
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
63
+ });
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
+ Object.defineProperty(exports, "__esModule", { value: true });
73
+ exports.UpgradeTransitiveDependencyVersion = void 0;
74
+ const recipe_1 = require("../../recipe");
75
+ const json_1 = require("../../json");
76
+ const node_resolution_result_1 = require("../node-resolution-result");
77
+ const path = __importStar(require("path"));
78
+ const semver = __importStar(require("semver"));
79
+ const markers_1 = require("../../markers");
80
+ const print_1 = require("../../print");
81
+ const package_manager_1 = require("../package-manager");
82
+ const dependency_manager_1 = require("../dependency-manager");
83
+ /**
84
+ * Upgrades the version of a transitive dependency by adding override entries to package.json.
85
+ *
86
+ * This recipe is used when you need to upgrade a dependency that is not directly declared
87
+ * in your package.json, but is pulled in transitively by one of your direct dependencies.
88
+ * This is commonly needed for security vulnerability remediation.
89
+ *
90
+ * The recipe adds entries to:
91
+ * - `overrides` for npm and Bun
92
+ * - `resolutions` for Yarn (Classic and Berry)
93
+ * - `pnpm.overrides` for pnpm
94
+ *
95
+ * @see UpgradeDependencyVersion for upgrading direct dependencies
96
+ */
97
+ class UpgradeTransitiveDependencyVersion extends recipe_1.ScanningRecipe {
98
+ constructor() {
99
+ super(...arguments);
100
+ this.name = "org.openrewrite.javascript.dependencies.upgrade-transitive-dependency-version";
101
+ this.displayName = "Upgrade transitive npm dependency version";
102
+ 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
+ }
104
+ 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
+ };
112
+ }
113
+ scanner(acc) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const recipe = this;
116
+ return new class extends json_1.JsonVisitor {
117
+ visitDocument(doc, _ctx) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ var _a;
120
+ // Only process package.json files
121
+ if (!doc.sourcePath.endsWith('package.json')) {
122
+ return doc;
123
+ }
124
+ const marker = (0, node_resolution_result_1.findNodeResolutionResult)(doc);
125
+ if (!marker) {
126
+ return doc;
127
+ }
128
+ // Get the project directory and package manager
129
+ const projectDir = path.dirname(path.resolve(doc.sourcePath));
130
+ const pm = (_a = marker.packageManager) !== null && _a !== void 0 ? _a : node_resolution_result_1.PackageManager.Npm;
131
+ // 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) {
134
+ const deps = marker[scope];
135
+ if (deps === null || deps === void 0 ? void 0 : deps.find(d => d.name === recipe.packageName)) {
136
+ // Package is a direct dependency, don't add override
137
+ return doc;
138
+ }
139
+ }
140
+ // Check if package exists as a transitive dependency (in resolvedDependencies)
141
+ // Note: There may be multiple versions of the same package installed
142
+ const resolvedVersions = node_resolution_result_1.NodeResolutionResultQueries.getAllResolvedVersions(marker, recipe.packageName);
143
+ if (resolvedVersions.length === 0) {
144
+ // Package not found in resolved dependencies at all
145
+ return doc;
146
+ }
147
+ // Check if ANY resolved version needs upgrading
148
+ // We need an override if at least one installed version doesn't satisfy the constraint
149
+ const anyVersionNeedsUpgrade = resolvedVersions.some(rd => !semver.satisfies(rd.version, recipe.newVersion));
150
+ if (!anyVersionNeedsUpgrade) {
151
+ // All installed versions already satisfy the constraint
152
+ return doc;
153
+ }
154
+ // Parse dependency path if specified
155
+ const dependencyPathSegments = recipe.dependencyPath
156
+ ? (0, dependency_manager_1.parseDependencyPath)(recipe.dependencyPath)
157
+ : undefined;
158
+ acc.projectsToUpdate.set(doc.sourcePath, {
159
+ projectDir,
160
+ packageJsonPath: doc.sourcePath,
161
+ originalPackageJson: yield this.printDocument(doc),
162
+ newVersion: recipe.newVersion,
163
+ packageManager: pm,
164
+ skipInstall: false, // Always need to run install for overrides
165
+ dependencyPathSegments
166
+ });
167
+ return doc;
168
+ });
169
+ }
170
+ printDocument(doc) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ return print_1.TreePrinters.print(doc);
173
+ });
174
+ }
175
+ };
176
+ });
177
+ }
178
+ editorWithData(acc) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ const recipe = this;
181
+ return new class extends json_1.JsonVisitor {
182
+ visitDocument(doc, ctx) {
183
+ return __awaiter(this, void 0, void 0, function* () {
184
+ const sourcePath = doc.sourcePath;
185
+ // Handle package.json files
186
+ if (sourcePath.endsWith('package.json')) {
187
+ const updateInfo = acc.projectsToUpdate.get(sourcePath);
188
+ if (!updateInfo) {
189
+ return doc; // This package.json doesn't need updating
190
+ }
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);
198
+ if (failureMessage) {
199
+ return (0, markers_1.markupWarn)(doc, `Failed to add override for ${recipe.packageName} to ${recipe.newVersion}`, failureMessage);
200
+ }
201
+ // Add override entries
202
+ const modifiedDoc = yield this.addOverrideEntry(doc, updateInfo);
203
+ // Update the NodeResolutionResult marker
204
+ return recipe.updateMarker(modifiedDoc, updateInfo, acc);
205
+ }
206
+ // 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
+ }
219
+ }
220
+ return doc;
221
+ });
222
+ }
223
+ /**
224
+ * Adds override entry to package.json for transitive dependency upgrade.
225
+ */
226
+ addOverrideEntry(doc, updateInfo) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ var _a, e_1, _b, _c;
229
+ // Parse current package.json content
230
+ const currentContent = yield print_1.TreePrinters.print(doc);
231
+ let packageJson;
232
+ try {
233
+ packageJson = JSON.parse(currentContent);
234
+ }
235
+ catch (_d) {
236
+ return doc; // Can't parse, return unchanged
237
+ }
238
+ // Apply override
239
+ const modifiedPackageJson = (0, dependency_manager_1.applyOverrideToPackageJson)(packageJson, updateInfo.packageManager, recipe.packageName, updateInfo.newVersion, updateInfo.dependencyPathSegments);
240
+ // Serialize back to JSON, preserving indentation
241
+ const indentMatch = currentContent.match(/^(\s+)"/m);
242
+ const indent = indentMatch ? indentMatch[1].length : 2;
243
+ const newContent = JSON.stringify(modifiedPackageJson, null, indent);
244
+ // 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;
295
+ });
296
+ }
297
+ };
298
+ });
299
+ }
300
+ /**
301
+ * Runs the package manager in a temporary directory to update the lock file.
302
+ */
303
+ runPackageManagerInstall(acc, updateInfo, _ctx) {
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ // Create modified package.json with the override
306
+ const modifiedPackageJson = this.createModifiedPackageJson(updateInfo.originalPackageJson, updateInfo);
307
+ 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
+ }
320
+ });
321
+ }
322
+ /**
323
+ * Creates a modified package.json with the override.
324
+ */
325
+ createModifiedPackageJson(originalContent, updateInfo) {
326
+ let packageJson = JSON.parse(originalContent);
327
+ packageJson = (0, dependency_manager_1.applyOverrideToPackageJson)(packageJson, updateInfo.packageManager, this.packageName, updateInfo.newVersion, updateInfo.dependencyPathSegments);
328
+ return JSON.stringify(packageJson, null, 2);
329
+ }
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
+ }
365
+ exports.UpgradeTransitiveDependencyVersion = UpgradeTransitiveDependencyVersion;
366
+ __decorate([
367
+ (0, recipe_1.Option)({
368
+ displayName: "Package name",
369
+ description: "The name of the npm package to upgrade (e.g., 'lodash', '@types/node')",
370
+ example: "lodash"
371
+ })
372
+ ], UpgradeTransitiveDependencyVersion.prototype, "packageName", void 0);
373
+ __decorate([
374
+ (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')",
377
+ example: "^5.0.0"
378
+ })
379
+ ], UpgradeTransitiveDependencyVersion.prototype, "newVersion", void 0);
380
+ __decorate([
381
+ (0, recipe_1.Option)({
382
+ displayName: "Dependency path",
383
+ description: "Optional path to scope the override to a specific dependency chain. Use '>' as separator (e.g., 'express>accepts'). When not specified, applies globally to all transitive occurrences.",
384
+ required: false,
385
+ example: "express>accepts"
386
+ })
387
+ ], UpgradeTransitiveDependencyVersion.prototype, "dependencyPath", void 0);
388
+ //# sourceMappingURL=upgrade-transitive-dependency-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-transitive-dependency-version.js","sourceRoot":"","sources":["../../../src/javascript/recipes/upgrade-transitive-dependency-version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoD;AAGpD,qCAAyD;AACzD,sEAQmC;AACnC,2CAA6B;AAC7B,+CAAiC;AACjC,2CAA8D;AAC9D,uCAAyC;AACzC,wDAA6F;AAC7F,8DAA6G;AA6C7G;;;;;;;;;;;;;GAaG;AACH,MAAa,kCAAmC,SAAQ,uBAA2B;IAAnF;;QACa,SAAI,GAAG,+EAA+E,CAAC;QACvF,gBAAW,GAAG,2CAA2C,CAAC;QAC1D,gBAAW,GAAG,mKAAmK,CAAC;IA4V/L,CAAC;IApUG,YAAY,CAAC,IAAsB;QAC/B,OAAO;YACH,gBAAgB,EAAE,IAAI,GAAG,EAAE;YAC3B,gBAAgB,EAAE,IAAI,GAAG,EAAE;YAC3B,mBAAmB,EAAE,IAAI,GAAG,EAAE;YAC9B,iBAAiB,EAAE,IAAI,GAAG,EAAE;YAC5B,cAAc,EAAE,IAAI,GAAG,EAAE;SAC5B,CAAC;IACN,CAAC;IAEK,OAAO,CAAC,GAAgB;;YAC1B,MAAM,MAAM,GAAG,IAAI,CAAC;YAEpB,OAAO,IAAI,KAAM,SAAQ,kBAA6B;gBAClC,aAAa,CAAC,G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AAY,CAAC,CAAC,CAAC,SAAS,CACrD,CAAC;YAEF,uCACO,GAAG,KACN,OAAO,EAAE,IAAA,6BAAmB,EAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,IACtD;QACN,CAAC;KAAA;CACJ;AA/VD,gFA+VC;AArVG;IALC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,wEAAwE;QACrF,OAAO,EAAE,QAAQ;KACpB,CAAC;uEACmB;AAOrB;IALC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE,uEAAuE;QACpF,OAAO,EAAE,QAAQ;KACpB,CAAC;sEACkB;AAQpB;IANC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,iBAAiB;QAC9B,WAAW,EAAE,yLAAyL;QACtM,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,iBAAiB;KAC7B,CAAC;0EACsB"}
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- 8.69.0-20251210-164937
1
+ 8.69.0-20251210-194227
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrewrite/rewrite",
3
- "version": "8.69.0-20251210-164937",
3
+ "version": "8.69.0-20251210-194227",
4
4
  "license": "Moderne Source Available License",
5
5
  "description": "OpenRewrite JavaScript.",
6
6
  "homepage": "https://github.com/openrewrite/rewrite",
package/src/index.ts CHANGED
@@ -38,7 +38,7 @@ export async function activate(registry: RecipeRegistry): Promise<void> {
38
38
  const {ModernizeOctalEscapeSequences, ModernizeOctalLiterals, RemoveDuplicateObjectKeys} = await import("./javascript/migrate/es6/index.js");
39
39
  const {ExportAssignmentToExportDefault} = await import("./javascript/migrate/typescript/index.js");
40
40
  const {UseObjectPropertyShorthand, PreferOptionalChain, AddParseIntRadix} = await import("./javascript/cleanup/index.js");
41
- const {AsyncCallbackInSyncArrayMethod, AutoFormat, UpgradeDependencyVersion, OrderImports, ChangeImport} = await import("./javascript/recipes/index.js");
41
+ const {AsyncCallbackInSyncArrayMethod, AutoFormat, UpgradeDependencyVersion, UpgradeTransitiveDependencyVersion, OrderImports, ChangeImport} = await import("./javascript/recipes/index.js");
42
42
  const {FindDependency} = await import("./javascript/search/index.js");
43
43
 
44
44
  registry.register(ExportAssignmentToExportDefault);
@@ -54,6 +54,7 @@ export async function activate(registry: RecipeRegistry): Promise<void> {
54
54
  registry.register(AsyncCallbackInSyncArrayMethod);
55
55
  registry.register(AutoFormat);
56
56
  registry.register(UpgradeDependencyVersion);
57
+ registry.register(UpgradeTransitiveDependencyVersion);
57
58
  }
58
59
 
59
60
  RpcCodecs.registerCodec(MarkersKind.ParseExceptionResult, {