@openrewrite/recipes-nodejs 0.53.0 → 0.54.0
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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/migrate/crypto-rsa-pss-key-pair-options.d.ts +9 -0
- package/dist/migrate/crypto-rsa-pss-key-pair-options.d.ts.map +1 -0
- package/dist/migrate/crypto-rsa-pss-key-pair-options.js +107 -0
- package/dist/migrate/crypto-rsa-pss-key-pair-options.js.map +1 -0
- package/dist/migrate/find-fs-rmdir-recursive.d.ts +9 -0
- package/dist/migrate/find-fs-rmdir-recursive.d.ts.map +1 -0
- package/dist/migrate/find-fs-rmdir-recursive.js +89 -0
- package/dist/migrate/find-fs-rmdir-recursive.js.map +1 -0
- package/dist/migrate/fs-access-constants.d.ts.map +1 -1
- package/dist/migrate/fs-access-constants.js +1 -1
- package/dist/migrate/fs-access-constants.js.map +1 -1
- package/dist/migrate/options-literal.d.ts +5 -0
- package/dist/migrate/options-literal.d.ts.map +1 -0
- package/dist/migrate/options-literal.js +55 -0
- package/dist/migrate/options-literal.js.map +1 -0
- package/dist/migrate/upgrade-node-26.d.ts.map +1 -1
- package/dist/migrate/upgrade-node-26.js +8 -0
- package/dist/migrate/upgrade-node-26.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +4 -0
- package/src/migrate/crypto-rsa-pss-key-pair-options.ts +119 -0
- package/src/migrate/find-fs-rmdir-recursive.ts +87 -0
- package/src/migrate/fs-access-constants.ts +1 -1
- package/src/migrate/options-literal.ts +66 -0
- package/src/migrate/upgrade-node-26.ts +9 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AA+E3E,eAAO,MAAM,MAAM,EAAE,kBAAkB,EAA+B,CAAC;AACvE,eAAO,MAAM,OAAO,EAAE,kBAAkB,EAA0C,CAAC;AACnF,eAAO,MAAM,OAAO,EAAE,kBAAkB,EAA4C,CAAC;AACrF,eAAO,MAAM,OAAO,EAAE,kBAAkB,EAA2C,CAAC;AACpF,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAAsD,CAAC;AACxG,eAAO,MAAM,gBAAgB,EAAE,kBAAkB,EAAsD,CAAC;AACxG,eAAO,MAAM,iBAAiB,EAAE,kBAAkB,EAAuD,CAAC;AAE1G,wBAAsB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0E5E"}
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,8 @@ const server_response_write_header_1 = require("./migrate/server-response-write-
|
|
|
48
48
|
const find_aead_decipheriv_without_auth_tag_length_1 = require("./migrate/find-aead-decipheriv-without-auth-tag-length");
|
|
49
49
|
const find_duplex_to_web_type_1 = require("./migrate/find-duplex-to-web-type");
|
|
50
50
|
const find_module_register_1 = require("./migrate/find-module-register");
|
|
51
|
+
const find_fs_rmdir_recursive_1 = require("./migrate/find-fs-rmdir-recursive");
|
|
52
|
+
const crypto_rsa_pss_key_pair_options_1 = require("./migrate/crypto-rsa-pss-key-pair-options");
|
|
51
53
|
const migrate_fs_extra_to_node_fs_1 = require("./migrate/fs-extra/migrate-fs-extra-to-node-fs");
|
|
52
54
|
const replace_fs_extra_remove_1 = require("./migrate/fs-extra/replace-fs-extra-remove");
|
|
53
55
|
const replace_fs_extra_mkdirs_1 = require("./migrate/fs-extra/replace-fs-extra-mkdirs");
|
|
@@ -128,6 +130,8 @@ function activate(marketplace) {
|
|
|
128
130
|
yield marketplace.install(find_aead_decipheriv_without_auth_tag_length_1.FindAeadDecipherivWithoutAuthTagLength, exports.Migrate);
|
|
129
131
|
yield marketplace.install(find_duplex_to_web_type_1.FindDuplexToWebType, exports.Migrate);
|
|
130
132
|
yield marketplace.install(find_module_register_1.FindModuleRegister, exports.Migrate);
|
|
133
|
+
yield marketplace.install(find_fs_rmdir_recursive_1.FindFsRmdirRecursive, exports.Migrate);
|
|
134
|
+
yield marketplace.install(crypto_rsa_pss_key_pair_options_1.ReplaceRsaPssKeyPairOptions, exports.Migrate);
|
|
131
135
|
yield marketplace.install(migrate_fs_extra_to_node_fs_1.MigrateFsExtraToNodeFs, exports.FsExtra);
|
|
132
136
|
yield marketplace.install(replace_fs_extra_remove_1.ReplaceFsExtraRemove, exports.FsExtra);
|
|
133
137
|
yield marketplace.install(replace_fs_extra_mkdirs_1.ReplaceFsExtraMkdirs, exports.FsExtra);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AA4FA,4BA0EC;AAhKD,qEAA0E;AAC1E,yDAAoE;AACpE,qEAAgF;AAChF,yEAAwF;AACxF,uEAAwE;AACxE,iDAAkD;AAClD,uDAAwD;AACxD,yEAAyE;AACzE,uDAAwD;AACxD,uDAAwD;AACxD,uEAAuE;AACvE,yEAAwE;AACxE,mEAA4E;AAC5E,uDAAwD;AACxD,+DAA6E;AAC7E,+DAA+D;AAC/D,uDAA8D;AAC9D,iFAAiF;AACjF,yEAAyE;AACzE,+EAA+E;AAC/E,yFAAuF;AACvF,+DAAwD;AACxD,+DAAwD;AACxD,+DAAwD;AACxD,+DAAwD;AACxD,yFAAiF;AACjF,6HAAkH;AAClH,mFAA2E;AAC3E,yFAAiF;AACjF,uEAAgE;AA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pD,MAAM,WAAW,CAAC,OAAO,CAAC,qDAAwB,EAAE,yBAAiB,CAAC,CAAC;QACvE,MAAM,WAAW,CAAC,OAAO,CAAC,sEAAgC,EAAE,yBAAiB,CAAC,CAAC;QAC/E,MAAM,WAAW,CAAC,OAAO,CAAC,4DAA2B,EAAE,yBAAiB,CAAC,CAAC;IAC9E,CAAC;CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExecutionContext, Recipe, TreeVisitor } from "@openrewrite/rewrite";
|
|
2
|
+
export declare class ReplaceRsaPssKeyPairOptions extends Recipe {
|
|
3
|
+
readonly name = "org.openrewrite.node.migrate.crypto.replace-rsa-pss-key-pair-options";
|
|
4
|
+
readonly displayName: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
readonly tags: string[];
|
|
7
|
+
editor(): Promise<TreeVisitor<any, ExecutionContext>>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=crypto-rsa-pss-key-pair-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto-rsa-pss-key-pair-options.d.ts","sourceRoot":"","sources":["../../src/migrate/crypto-rsa-pss-key-pair-options.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,gBAAgB,EAAgB,MAAM,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAoBhG,qBAAa,2BAA4B,SAAQ,MAAM;IACnD,QAAQ,CAAC,IAAI,0EAAyE;IACtF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAoE;IAChG,QAAQ,CAAC,WAAW,EAAE,MAAM,CAIiF;IAC7G,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAe;IAEhC,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;CA8B9D"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ReplaceRsaPssKeyPairOptions = void 0;
|
|
13
|
+
const rewrite_1 = require("@openrewrite/rewrite");
|
|
14
|
+
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
15
|
+
const java_1 = require("@openrewrite/rewrite/java");
|
|
16
|
+
const fs_extra_support_1 = require("./fs-extra/fs-extra-support");
|
|
17
|
+
const module_bindings_1 = require("./module-bindings");
|
|
18
|
+
const options_literal_1 = require("./options-literal");
|
|
19
|
+
const KEY_PAIR_GENERATORS = [
|
|
20
|
+
"crypto generateKeyPair(..)",
|
|
21
|
+
"crypto generateKeyPairSync(..)",
|
|
22
|
+
"generateKeyPair __promisify__(..)",
|
|
23
|
+
];
|
|
24
|
+
const RENAMED = new Map([
|
|
25
|
+
["hash", "hashAlgorithm"],
|
|
26
|
+
["mgf1Hash", "mgf1HashAlgorithm"],
|
|
27
|
+
]);
|
|
28
|
+
class ReplaceRsaPssKeyPairOptions extends rewrite_1.Recipe {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.name = "org.openrewrite.node.migrate.crypto.replace-rsa-pss-key-pair-options";
|
|
32
|
+
this.displayName = "Replace removed RSA-PSS `hash` and `mgf1Hash` key pair options";
|
|
33
|
+
this.description = "Rename the `hash` and `mgf1Hash` options of `crypto.generateKeyPair('rsa-pss', ...)` " +
|
|
34
|
+
"and `crypto.generateKeyPairSync('rsa-pss', ...)` to `hashAlgorithm` and `mgf1HashAlgorithm`, the names " +
|
|
35
|
+
"Node.js 16.10 added. Node.js 25 removed the old names (DEP0154) and throws `ERR_INVALID_ARG_VALUE` for them, " +
|
|
36
|
+
"where earlier versions read each the same as its new name. Options are renamed where they are written as an " +
|
|
37
|
+
"object literal, unless it already gives the new name or has keys that can't be read, such as a spread.";
|
|
38
|
+
this.tags = ["DEP0154"];
|
|
39
|
+
}
|
|
40
|
+
editor() {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return (0, rewrite_1.check)((0, rewrite_1.or)(...KEY_PAIR_GENERATORS.map(pattern => (0, javascript_1.usesMethod)(pattern))), new class extends javascript_1.JavaScriptVisitor {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this.generators = KEY_PAIR_GENERATORS.map(pattern => new javascript_1.MethodMatcher(pattern));
|
|
46
|
+
}
|
|
47
|
+
visitMethodInvocation(m, p) {
|
|
48
|
+
const _super = Object.create(null, {
|
|
49
|
+
visitMethodInvocation: { get: () => super.visitMethodInvocation }
|
|
50
|
+
});
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const method = yield _super.visitMethodInvocation.call(this, m, p);
|
|
53
|
+
if (!this.generators.some(generator => generator.matches(method.methodType))) {
|
|
54
|
+
return method;
|
|
55
|
+
}
|
|
56
|
+
const [type, options] = method.arguments.elements;
|
|
57
|
+
if ((0, module_bindings_1.stringLiteral)((0, options_literal_1.withoutCasts)(type === null || type === void 0 ? void 0 : type.element)) !== "rsa-pss" || !options) {
|
|
58
|
+
return method;
|
|
59
|
+
}
|
|
60
|
+
const literal = (0, options_literal_1.optionsLiteral)(options.element);
|
|
61
|
+
const renamed = literal && renameOptions(literal);
|
|
62
|
+
if (!renamed || renamed === literal) {
|
|
63
|
+
return method;
|
|
64
|
+
}
|
|
65
|
+
return Object.assign(Object.assign({}, method), { arguments: Object.assign(Object.assign({}, method.arguments), { elements: method.arguments.elements.map(arg => arg === options ? Object.assign(Object.assign({}, arg), { element: (0, options_literal_1.withOptionsLiteral)(arg.element, renamed) }) : arg) }) });
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.ReplaceRsaPssKeyPairOptions = ReplaceRsaPssKeyPairOptions;
|
|
73
|
+
function renameOptions(options) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const members = (_b = (_a = options.body) === null || _a === void 0 ? void 0 : _a.statements) !== null && _b !== void 0 ? _b : [];
|
|
76
|
+
const names = members.map(member => member.element.kind === javascript_1.JS.Kind.PropertyAssignment
|
|
77
|
+
? (0, fs_extra_support_1.propertyNameOf)(member.element)
|
|
78
|
+
: undefined);
|
|
79
|
+
if (names.some(name => name === undefined)) {
|
|
80
|
+
return options;
|
|
81
|
+
}
|
|
82
|
+
let renamed = false;
|
|
83
|
+
const statements = members.map((member, i) => {
|
|
84
|
+
const to = RENAMED.get(names[i]);
|
|
85
|
+
if (!to || names.includes(to)) {
|
|
86
|
+
return member;
|
|
87
|
+
}
|
|
88
|
+
renamed = true;
|
|
89
|
+
return Object.assign(Object.assign({}, member), { element: renameProperty(member.element, to) });
|
|
90
|
+
});
|
|
91
|
+
return renamed ? Object.assign(Object.assign({}, options), { body: Object.assign(Object.assign({}, options.body), { statements }) }) : options;
|
|
92
|
+
}
|
|
93
|
+
function renameProperty(property, to) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
const key = property.name.element;
|
|
96
|
+
if ((0, java_1.isIdentifier)(key)) {
|
|
97
|
+
const renamedKey = Object.assign(Object.assign({}, key), { simpleName: to, fieldType: undefined });
|
|
98
|
+
if (property.initializer) {
|
|
99
|
+
return Object.assign(Object.assign({}, property), { name: Object.assign(Object.assign({}, property.name), { element: renamedKey }) });
|
|
100
|
+
}
|
|
101
|
+
return Object.assign(Object.assign({}, property), { name: Object.assign(Object.assign({}, property.name), { element: Object.assign(Object.assign({}, renamedKey), { id: (0, rewrite_1.randomId)() }) }), assigmentToken: "Colon", initializer: Object.assign(Object.assign({}, key), { prefix: (0, java_1.space)(' ') }) });
|
|
102
|
+
}
|
|
103
|
+
const literal = key;
|
|
104
|
+
const quote = (_b = (_a = literal.valueSource) === null || _a === void 0 ? void 0 : _a.charAt(0)) !== null && _b !== void 0 ? _b : "'";
|
|
105
|
+
return Object.assign(Object.assign({}, property), { name: Object.assign(Object.assign({}, property.name), { element: Object.assign(Object.assign({}, literal), { value: to, valueSource: `${quote}${to}${quote}`, unicodeEscapes: undefined }) }) });
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=crypto-rsa-pss-key-pair-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto-rsa-pss-key-pair-options.js","sourceRoot":"","sources":["../../src/migrate/crypto-rsa-pss-key-pair-options.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAAgG;AAChG,gEAAiG;AACjG,oDAAiE;AACjE,kEAA2D;AAC3D,uDAAgD;AAChD,uDAAmF;AAEnF,MAAM,mBAAmB,GAAG;IACxB,4BAA4B;IAC5B,gCAAgC;IAEhC,mCAAmC;CACtC,CAAC;AAGF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACpB,CAAC,MAAM,EAAE,eAAe,CAAC;IACzB,CAAC,UAAU,EAAE,mBAAmB,CAAC;CACpC,CAAC,CAAC;AAEH,MAAa,2BAA4B,SAAQ,gBAAM;IAAvD;;QACa,SAAI,GAAG,sEAAsE,CAAA;QAC7E,gBAAW,GAAW,gEAAgE,CAAC;QACvF,gBAAW,GAAW,uFAAuF;YAClH,yGAAyG;YACzG,+GAA+G;YAC/G,8GAA8G;YAC9G,wGAAwG,CAAC;QACpG,SAAI,GAAa,CAAC,SAAS,CAAC,CAAC;IAgC1C,CAAC;IA9BS,MAAM;;YACR,OAAO,IAAA,e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+
export declare class FindFsRmdirRecursive extends Recipe {
|
|
3
|
+
readonly name = "org.openrewrite.node.migrate.fs.find-rmdir-recursive";
|
|
4
|
+
readonly displayName: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
readonly tags: string[];
|
|
7
|
+
editor(): Promise<TreeVisitor<any, ExecutionContext>>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=find-fs-rmdir-recursive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-fs-rmdir-recursive.d.ts","sourceRoot":"","sources":["../../src/migrate/find-fs-rmdir-recursive.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,gBAAgB,EAAyB,MAAM,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAgCzG,qBAAa,oBAAqB,SAAQ,MAAM;IAC5C,QAAQ,CAAC,IAAI,0DAAyD;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAiE;IAC7F,QAAQ,CAAC,WAAW,EAAE,MAAM,CAKU;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAe;IAEhC,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;CAa9D"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FindFsRmdirRecursive = void 0;
|
|
13
|
+
const rewrite_1 = require("@openrewrite/rewrite");
|
|
14
|
+
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
15
|
+
const java_1 = require("@openrewrite/rewrite/java");
|
|
16
|
+
const fs_extra_support_1 = require("./fs-extra/fs-extra-support");
|
|
17
|
+
const options_literal_1 = require("./options-literal");
|
|
18
|
+
const RMDIR_FORMS = [
|
|
19
|
+
{
|
|
20
|
+
pattern: "fs rmdir(..)", api: "fs.rmdir()", fails: "throws", failed: "failed with",
|
|
21
|
+
rm: "fs.rm(path, { recursive: true }, callback)"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
pattern: "fs rmdirSync(..)", api: "fs.rmdirSync()", fails: "throws", failed: "threw",
|
|
25
|
+
rm: "fs.rmSync(path, { recursive: true })"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
pattern: "fs/promises rmdir(..)", api: "fs.promises.rmdir()", fails: "rejects with", failed: "rejected with",
|
|
29
|
+
rm: "fs.promises.rm(path, { recursive: true })"
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
class FindFsRmdirRecursive extends rewrite_1.Recipe {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.name = "org.openrewrite.node.migrate.fs.find-rmdir-recursive";
|
|
36
|
+
this.displayName = "Find `fs.rmdir()` calls with the removed `recursive` option";
|
|
37
|
+
this.description = "Node.js 25 removed the `recursive` option of `fs.rmdir()`, `fs.rmdirSync()` and " +
|
|
38
|
+
"`fs.promises.rmdir()` (DEP0147), which now fail with `ERR_INVALID_ARG_VALUE` whenever it is passed, even as " +
|
|
39
|
+
"`false`. `fs.rm()` with `recursive: true` removes a directory tree the same way, but it is not an " +
|
|
40
|
+
"exact replacement: it deletes a file where `fs.rmdir()` failed with `ENOTDIR`, and with `force: true`, as Node.js " +
|
|
41
|
+
"suggests, it also ignores a missing path. So the calls are marked to be changed by hand. Only options written " +
|
|
42
|
+
"as an object literal are found.";
|
|
43
|
+
this.tags = ["DEP0147"];
|
|
44
|
+
}
|
|
45
|
+
editor() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
return (0, rewrite_1.check)((0, rewrite_1.or)(...RMDIR_FORMS.map(form => (0, javascript_1.usesMethod)(form.pattern))), new class extends javascript_1.JavaScriptVisitor {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
this.forms = RMDIR_FORMS.map(form => ({ form, matcher: new javascript_1.MethodMatcher(form.pattern) }));
|
|
51
|
+
}
|
|
52
|
+
visitMethodInvocation(m, p) {
|
|
53
|
+
const _super = Object.create(null, {
|
|
54
|
+
visitMethodInvocation: { get: () => super.visitMethodInvocation }
|
|
55
|
+
});
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
const method = yield _super.visitMethodInvocation.call(this, m, p);
|
|
59
|
+
const form = (_a = this.forms.find(f => f.matcher.matches(method.methodType))) === null || _a === void 0 ? void 0 : _a.form;
|
|
60
|
+
const options = form && (0, options_literal_1.optionsLiteral)((_b = method.arguments.elements[1]) === null || _b === void 0 ? void 0 : _b.element);
|
|
61
|
+
const recursive = options && recursiveOption(options);
|
|
62
|
+
return form && recursive ? (0, rewrite_1.foundSearchResult)(method, message(form, recursive)) : method;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.FindFsRmdirRecursive = FindFsRmdirRecursive;
|
|
70
|
+
function recursiveOption(options) {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
let value;
|
|
73
|
+
for (const member of (_b = (_a = options.body) === null || _a === void 0 ? void 0 : _a.statements) !== null && _b !== void 0 ? _b : []) {
|
|
74
|
+
const property = member.element;
|
|
75
|
+
if (property.kind === javascript_1.JS.Kind.PropertyAssignment && (0, fs_extra_support_1.propertyNameOf)(property) === "recursive") {
|
|
76
|
+
value = (_c = property.initializer) !== null && _c !== void 0 ? _c : property.name.element;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return value && !((0, java_1.isIdentifier)(value) && value.simpleName === "undefined") ? value : undefined;
|
|
80
|
+
}
|
|
81
|
+
function message(form, recursive) {
|
|
82
|
+
const removed = `${form.api} ${form.fails} ERR_INVALID_ARG_VALUE for the recursive option since Node.js 25`;
|
|
83
|
+
if (recursive.kind === java_1.J.Kind.Literal && recursive.value === false) {
|
|
84
|
+
return `${removed}, even when it is false (DEP0147). Remove the option.`;
|
|
85
|
+
}
|
|
86
|
+
return `${removed} (DEP0147). ${form.rm} removes the directory tree as before, but deletes a file where ` +
|
|
87
|
+
`${form.api} ${form.failed} ENOTDIR, and force: true also ignores a missing path.`;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=find-fs-rmdir-recursive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-fs-rmdir-recursive.js","sourceRoot":"","sources":["../../src/migrate/find-fs-rmdir-recursive.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAAyG;AACzG,gEAAiG;AACjG,oDAA0D;AAC1D,kEAA2D;AAC3D,uDAAiD;AAajD,MAAM,WAAW,GAAgB;IAC7B;QACI,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa;QAClF,EAAE,EAAE,4CAA4C;KACnD;IACD;QACI,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO;QACpF,EAAE,EAAE,sCAAsC;KAC7C;IACD;QACI,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eA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AAI,CAAC,GAAG,IAAI,IAAI,CAAC,MAAM,wDAAwD,CAAC;AAC3F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-access-constants.d.ts","sourceRoot":"","sources":["../../src/migrate/fs-access-constants.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,gBAAgB,EAAM,MAAM,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAOtF,qBAAa,wBAAyB,SAAQ,MAAM;IAChD,QAAQ,CAAC,IAAI,iEAAgE;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAyF;IACrH,QAAQ,CAAC,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fs-access-constants.d.ts","sourceRoot":"","sources":["../../src/migrate/fs-access-constants.ts"],"names":[],"mappings":"AAKA,OAAO,EAAQ,gBAAgB,EAAM,MAAM,EAAE,WAAW,EAAC,MAAM,sBAAsB,CAAC;AAOtF,qBAAa,wBAAyB,SAAQ,MAAM;IAChD,QAAQ,CAAC,IAAI,iEAAgE;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAyF;IACrH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAA0O;IACtQ,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAe;IAEhC,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;CAoD9D"}
|
|
@@ -18,7 +18,7 @@ class ReplaceFsAccessConstants extends rewrite_1.Recipe {
|
|
|
18
18
|
super(...arguments);
|
|
19
19
|
this.name = "org.openrewrite.node.migrate.fs.replace-fs-access-constants";
|
|
20
20
|
this.displayName = "Replace deprecated `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` with `fs.constants.*`";
|
|
21
|
-
this.description = "Replace deprecated file access constants (`fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`) with their equivalents from `fs.constants`. These constants were removed in Node.js
|
|
21
|
+
this.description = "Replace deprecated file access constants (`fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`) with their equivalents from `fs.constants`. These constants were removed in Node.js 25 and should be accessed through the constants namespace.";
|
|
22
22
|
this.tags = ["DEP0176"];
|
|
23
23
|
}
|
|
24
24
|
editor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-access-constants.js","sourceRoot":"","sources":["../../src/migrate/fs-access-constants.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAAsF;AACtF,gEAAsF;AACtF,oDAAkD;AAKlD,MAAa,wBAAyB,SAAQ,gBAAM;IAApD;;QACa,SAAI,GAAG,6DAA6D,CAAA;QACpE,gBAAW,GAAW,qFAAqF,CAAC;QAC5G,gBAAW,GAAW,
|
|
1
|
+
{"version":3,"file":"fs-access-constants.js","sourceRoot":"","sources":["../../src/migrate/fs-access-constants.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAAsF;AACtF,gEAAsF;AACtF,oDAAkD;AAKlD,MAAa,wBAAyB,SAAQ,gBAAM;IAApD;;QACa,SAAI,GAAG,6DAA6D,CAAA;QACpE,gBAAW,GAAW,qFAAqF,CAAC;QAC5G,gBAAW,GAAW,sOAAsO,CAAC;QAC7P,SAAI,GAAa,CAAC,SAAS,CAAC,CAAC;IAsD1C,CAAC;IApDS,MAAM;;YACR,OAAO,IAAA,eAAK,EAAC,IAAA,YAAE,EAAC,IAAA,qBAAQ,EAAC,IAAI,CAAC,EAAE,IAAA,qBAAQ,EAAC,SAAS,CAAC,CAAC,EAAE,IAAI,KAAM,SAAQ,8BAAmC;gBAG/F,kBAAkB,CAAC,WAA0B;oBACjD,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;oBAGzD,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;wBAC3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M,EAAE,CAAC;gCACjC,OAAO,MAAM,IAAA,qBAAQ,EAAA,GAAG,YAAY,iBAAiB,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;4BACpF,CAAC;iCAAM,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;gCACjC,OAAO,MAAM,IAAA,qBAAQ,EAAA,GAAG,YAAY,iBAAiB,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;4BACpF,CAAC;wBACL,CAAC;wBAED,OAAO,KAAK,CAAC;oBACjB,CAAC;iBAAA;aACJ,CAAC,CAAC;QACP,CAAC;KAAA;CACJ;AA1DD,4DA0DC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { J } from "@openrewrite/rewrite/java";
|
|
2
|
+
export declare function withoutCasts(e: J | undefined): J | undefined;
|
|
3
|
+
export declare function optionsLiteral(arg: J | undefined): J.NewClass | undefined;
|
|
4
|
+
export declare function withOptionsLiteral(arg: J, literal: J.NewClass): J;
|
|
5
|
+
//# sourceMappingURL=options-literal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options-literal.d.ts","sourceRoot":"","sources":["../../src/migrate/options-literal.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,CAAC,EAAC,MAAM,2BAA2B,CAAC;AAKxD,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS,CAmB5D;AAMD,wBAAgB,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,QAAQ,GAAG,SAAS,CAGzE;AAGD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAwBjE"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withoutCasts = withoutCasts;
|
|
4
|
+
exports.optionsLiteral = optionsLiteral;
|
|
5
|
+
exports.withOptionsLiteral = withOptionsLiteral;
|
|
6
|
+
const java_1 = require("@openrewrite/rewrite/java");
|
|
7
|
+
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
8
|
+
const fs_extra_support_1 = require("./fs-extra/fs-extra-support");
|
|
9
|
+
function withoutCasts(e) {
|
|
10
|
+
for (;;) {
|
|
11
|
+
switch (e === null || e === void 0 ? void 0 : e.kind) {
|
|
12
|
+
case java_1.J.Kind.Parentheses:
|
|
13
|
+
e = e.tree.element;
|
|
14
|
+
break;
|
|
15
|
+
case javascript_1.JS.Kind.As:
|
|
16
|
+
e = e.left.element;
|
|
17
|
+
break;
|
|
18
|
+
case java_1.J.Kind.TypeCast:
|
|
19
|
+
e = e.expression;
|
|
20
|
+
break;
|
|
21
|
+
case javascript_1.JS.Kind.SatisfiesExpression:
|
|
22
|
+
e = e.expression;
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function optionsLiteral(arg) {
|
|
30
|
+
const e = withoutCasts(arg);
|
|
31
|
+
return (0, fs_extra_support_1.isObjectLiteral)(e) ? e : undefined;
|
|
32
|
+
}
|
|
33
|
+
function withOptionsLiteral(arg, literal) {
|
|
34
|
+
switch (arg.kind) {
|
|
35
|
+
case java_1.J.Kind.Parentheses: {
|
|
36
|
+
const parentheses = arg;
|
|
37
|
+
return Object.assign(Object.assign({}, parentheses), { tree: Object.assign(Object.assign({}, parentheses.tree), { element: withOptionsLiteral(parentheses.tree.element, literal) }) });
|
|
38
|
+
}
|
|
39
|
+
case javascript_1.JS.Kind.As: {
|
|
40
|
+
const as = arg;
|
|
41
|
+
return Object.assign(Object.assign({}, as), { left: Object.assign(Object.assign({}, as.left), { element: withOptionsLiteral(as.left.element, literal) }) });
|
|
42
|
+
}
|
|
43
|
+
case java_1.J.Kind.TypeCast: {
|
|
44
|
+
const cast = arg;
|
|
45
|
+
return Object.assign(Object.assign({}, cast), { expression: withOptionsLiteral(cast.expression, literal) });
|
|
46
|
+
}
|
|
47
|
+
case javascript_1.JS.Kind.SatisfiesExpression: {
|
|
48
|
+
const satisfies = arg;
|
|
49
|
+
return Object.assign(Object.assign({}, satisfies), { expression: withOptionsLiteral(satisfies.expression, literal) });
|
|
50
|
+
}
|
|
51
|
+
default:
|
|
52
|
+
return literal;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=options-literal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options-literal.js","sourceRoot":"","sources":["../../src/migrate/options-literal.ts"],"names":[],"mappings":";;AAUA,oCAmBC;AAMD,wCAGC;AAGD,gDAwBC;AA5DD,oDAAwD;AACxD,gEAAmD;AACnD,kEAA4D;AAG5D,SAAgB,YAAY,CAAC,CAAgB;IACzC,SAAS,CAAC;QACN,QAAQ,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,IAAI,EAAE,CAAC;YACd,KAAK,QAAC,CAAC,IAAI,CAAC,WAAW;gBACnB,CAAC,GAAI,CAAsB,CAAC,IAAI,CAAC,OAAO,CAAC;gBACzC,MAAM;YACV,KAAK,eAAE,CAAC,IAAI,CAAC,EAAE;gBACX,CAAC,GAAI,CAAW,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,MAAM;YACV,KAAK,QAAC,CAAC,IAAI,CAAC,QAAQ;gBAChB,CAAC,GAAI,CAAgB,CAAC,UAAU,CAAC;gBACjC,MAAM;YACV,KAAK,eAAE,CAAC,IAAI,CAAC,mBAAmB;gBAC5B,CAAC,GAAI,CAA4B,CAAC,UAAU,CAAC;gBAC7C,MAAM;YACV;gBACI,OAAO,CAAC,CAAC;QACjB,CAAC;IACL,CAAC;AACL,CAAC;AAMD,SAAgB,cAAc,CAAC,GAAkB;IAC7C,MAAM,CAAC,G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,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-node-26.d.ts","sourceRoot":"","sources":["../../src/migrate/upgrade-node-26.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade-node-26.d.ts","sourceRoot":"","sources":["../../src/migrate/upgrade-node-26.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAgC5C,qBAAa,aAAc,SAAQ,MAAM;IACrC,QAAQ,CAAC,IAAI,kDAAkD;IAC/D,QAAQ,CAAC,WAAW,2BAA2B;IAC/C,QAAQ,CAAC,WAAW,2IAA2I;IAEzJ,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAUxC"}
|
|
@@ -20,7 +20,15 @@ const server_response_write_header_1 = require("./server-response-write-header")
|
|
|
20
20
|
const find_aead_decipheriv_without_auth_tag_length_1 = require("./find-aead-decipheriv-without-auth-tag-length");
|
|
21
21
|
const find_duplex_to_web_type_1 = require("./find-duplex-to-web-type");
|
|
22
22
|
const find_module_register_1 = require("./find-module-register");
|
|
23
|
+
const find_fs_rmdir_recursive_1 = require("./find-fs-rmdir-recursive");
|
|
24
|
+
const crypto_rsa_pss_key_pair_options_1 = require("./crypto-rsa-pss-key-pair-options");
|
|
25
|
+
const slow_buffer_1 = require("./slow-buffer");
|
|
26
|
+
const fs_access_constants_1 = require("./fs-access-constants");
|
|
23
27
|
const node26EolDeprecations = [
|
|
28
|
+
new slow_buffer_1.ReplaceSlowBuffer(),
|
|
29
|
+
new find_fs_rmdir_recursive_1.FindFsRmdirRecursive(),
|
|
30
|
+
new crypto_rsa_pss_key_pair_options_1.ReplaceRsaPssKeyPairOptions(),
|
|
31
|
+
new fs_access_constants_1.ReplaceFsAccessConstants(),
|
|
24
32
|
new server_response_write_header_1.ReplaceServerResponseWriteHeader(),
|
|
25
33
|
new stream_internal_modules_1.ReplaceStreamInternalModules(),
|
|
26
34
|
new find_aead_decipheriv_without_auth_tag_length_1.FindAeadDecipherivWithoutAuthTagLength(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade-node-26.js","sourceRoot":"","sources":["../../src/migrate/upgrade-node-26.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAA4C;AAC5C,kDAA2D;AAC3D,uDAAgD;AAChD,iFAAyE;AACzE,qHAA0G;AAC1G,uEAAuE;AACvE,iFAAgF;AAChF,iHAAsG;AACtG,uEAA8D;AAC9D,iEAA0D;
|
|
1
|
+
{"version":3,"file":"upgrade-node-26.js","sourceRoot":"","sources":["../../src/migrate/upgrade-node-26.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kDAA4C;AAC5C,kDAA2D;AAC3D,uDAAgD;AAChD,iFAAyE;AACzE,qHAA0G;AAC1G,uEAAuE;AACvE,iFAAgF;AAChF,iHAAsG;AACtG,uEAA8D;AAC9D,iEAA0D;AAC1D,uEAA+D;AAC/D,uFAA8E;AAC9E,+CAAgD;AAChD,+DAA+D;AAG/D,MAAM,qBAAqB,GAAa;IACpC,IAAI,+BAAiB,EAAE;IACvB,IAAI,8CAAoB,EAAE;IAC1B,IAAI,6DAA2B,EAAE;IACjC,IAAI,8CAAwB,EAAE;IAC9B,IAAI,+DAAgC,EAAE;IACtC,IAAI,sDAA4B,EAAE;IAClC,IAAI,qFAAsC,EAAE;CAC/C,CAAC;AAGF,MAAM,yBAAyB,GAAa;IACxC,IAAI,6CAAmB,EAAE;IACzB,IAAI,yCAAkB,EAAE;CAC3B,CAAC;AAEF,MAAa,aAAc,SAAQ,gBAAM;IAAzC;;QACa,SAAI,GAAG,8CAA8C,CAAC;QACtD,gBAAW,GAAG,uBAAuB,CAAC;QACtC,gBAAW,GAAG,uIAAuI,CAAC;IAYnK,CAAC;IAVS,UAAU;;YACZ,OAAO;gBACH,IAAI,wDAAyB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;gBAC9C,IAAI,yFAAwC,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;gBAC7D,MAAM,IAAA,uBAAiB,EAAC,mDAAmD,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;gBAC7F,IAAI,+BAAa,EAAE;gBACnB,GAAG,qBAAqB;gBACxB,GAAG,yBAAyB;aAC/B,CAAC;QACN,CAAC;KAAA;CACJ;AAfD,sCAeC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrewrite/recipes-nodejs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"license": "Moderne Proprietary",
|
|
5
5
|
"description": "OpenRewrite recipes for Node.js library migrations.",
|
|
6
6
|
"homepage": "https://github.com/moderneinc/rewrite-node",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"ci:test": "jest"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@openrewrite/rewrite": "^8.
|
|
28
|
+
"@openrewrite/rewrite": "^8.95.0",
|
|
29
29
|
"mutative": "^1.1.0",
|
|
30
30
|
"semver": "^7.7.3"
|
|
31
31
|
},
|
package/src/index.ts
CHANGED
|
@@ -41,6 +41,8 @@ import {ReplaceServerResponseWriteHeader} from "./migrate/server-response-write-
|
|
|
41
41
|
import {FindAeadDecipherivWithoutAuthTagLength} from "./migrate/find-aead-decipheriv-without-auth-tag-length";
|
|
42
42
|
import {FindDuplexToWebType} from "./migrate/find-duplex-to-web-type";
|
|
43
43
|
import {FindModuleRegister} from "./migrate/find-module-register";
|
|
44
|
+
import {FindFsRmdirRecursive} from "./migrate/find-fs-rmdir-recursive";
|
|
45
|
+
import {ReplaceRsaPssKeyPairOptions} from "./migrate/crypto-rsa-pss-key-pair-options";
|
|
44
46
|
import {MigrateFsExtraToNodeFs} from "./migrate/fs-extra/migrate-fs-extra-to-node-fs";
|
|
45
47
|
import {ReplaceFsExtraRemove} from "./migrate/fs-extra/replace-fs-extra-remove";
|
|
46
48
|
import {ReplaceFsExtraMkdirs} from "./migrate/fs-extra/replace-fs-extra-mkdirs";
|
|
@@ -126,6 +128,8 @@ export async function activate(marketplace: RecipeMarketplace): Promise<void> {
|
|
|
126
128
|
await marketplace.install(FindAeadDecipherivWithoutAuthTagLength, Migrate);
|
|
127
129
|
await marketplace.install(FindDuplexToWebType, Migrate);
|
|
128
130
|
await marketplace.install(FindModuleRegister, Migrate);
|
|
131
|
+
await marketplace.install(FindFsRmdirRecursive, Migrate);
|
|
132
|
+
await marketplace.install(ReplaceRsaPssKeyPairOptions, Migrate);
|
|
129
133
|
await marketplace.install(MigrateFsExtraToNodeFs, FsExtra);
|
|
130
134
|
await marketplace.install(ReplaceFsExtraRemove, FsExtra);
|
|
131
135
|
await marketplace.install(ReplaceFsExtraMkdirs, FsExtra);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
import {check, ExecutionContext, or, randomId, Recipe, TreeVisitor} from "@openrewrite/rewrite";
|
|
7
|
+
import {JavaScriptVisitor, JS, MethodMatcher, usesMethod} from "@openrewrite/rewrite/javascript";
|
|
8
|
+
import {isIdentifier, J, space} from "@openrewrite/rewrite/java";
|
|
9
|
+
import {propertyNameOf} from "./fs-extra/fs-extra-support";
|
|
10
|
+
import {stringLiteral} from "./module-bindings";
|
|
11
|
+
import {optionsLiteral, withOptionsLiteral, withoutCasts} from "./options-literal";
|
|
12
|
+
|
|
13
|
+
const KEY_PAIR_GENERATORS = [
|
|
14
|
+
"crypto generateKeyPair(..)",
|
|
15
|
+
"crypto generateKeyPairSync(..)",
|
|
16
|
+
// `util.promisify(crypto.generateKeyPair)`, which @types/node types as `generateKeyPair.__promisify__`.
|
|
17
|
+
"generateKeyPair __promisify__(..)",
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
/** The name Node.js 16.10 gave each option it later removed. */
|
|
21
|
+
const RENAMED = new Map([
|
|
22
|
+
["hash", "hashAlgorithm"],
|
|
23
|
+
["mgf1Hash", "mgf1HashAlgorithm"],
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
export class ReplaceRsaPssKeyPairOptions extends Recipe {
|
|
27
|
+
readonly name = "org.openrewrite.node.migrate.crypto.replace-rsa-pss-key-pair-options"
|
|
28
|
+
readonly displayName: string = "Replace removed RSA-PSS `hash` and `mgf1Hash` key pair options";
|
|
29
|
+
readonly description: string = "Rename the `hash` and `mgf1Hash` options of `crypto.generateKeyPair('rsa-pss', ...)` " +
|
|
30
|
+
"and `crypto.generateKeyPairSync('rsa-pss', ...)` to `hashAlgorithm` and `mgf1HashAlgorithm`, the names " +
|
|
31
|
+
"Node.js 16.10 added. Node.js 25 removed the old names (DEP0154) and throws `ERR_INVALID_ARG_VALUE` for them, " +
|
|
32
|
+
"where earlier versions read each the same as its new name. Options are renamed where they are written as an " +
|
|
33
|
+
"object literal, unless it already gives the new name or has keys that can't be read, such as a spread.";
|
|
34
|
+
readonly tags: string[] = ["DEP0154"];
|
|
35
|
+
|
|
36
|
+
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
37
|
+
return check(or(...KEY_PAIR_GENERATORS.map(pattern => usesMethod(pattern))), new class extends JavaScriptVisitor<ExecutionContext> {
|
|
38
|
+
generators = KEY_PAIR_GENERATORS.map(pattern => new MethodMatcher(pattern));
|
|
39
|
+
|
|
40
|
+
protected async visitMethodInvocation(m: J.MethodInvocation, p: ExecutionContext): Promise<J | undefined> {
|
|
41
|
+
const method = await super.visitMethodInvocation(m, p) as J.MethodInvocation;
|
|
42
|
+
if (!this.generators.some(generator => generator.matches(method.methodType))) {
|
|
43
|
+
return method;
|
|
44
|
+
}
|
|
45
|
+
const [type, options] = method.arguments.elements;
|
|
46
|
+
// Only `rsa-pss` reads these options; every other key type ignores them, as it always did.
|
|
47
|
+
if (stringLiteral(withoutCasts(type?.element)) !== "rsa-pss" || !options) {
|
|
48
|
+
return method;
|
|
49
|
+
}
|
|
50
|
+
const literal = optionsLiteral(options.element);
|
|
51
|
+
const renamed = literal && renameOptions(literal);
|
|
52
|
+
if (!renamed || renamed === literal) {
|
|
53
|
+
return method;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...method,
|
|
57
|
+
arguments: {
|
|
58
|
+
...method.arguments,
|
|
59
|
+
elements: method.arguments.elements.map(arg =>
|
|
60
|
+
arg === options ? {...arg, element: withOptionsLiteral(arg.element, renamed)} : arg)
|
|
61
|
+
}
|
|
62
|
+
} as J.MethodInvocation;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The literal with each removed option under its new name. An option is left alone where the
|
|
70
|
+
* literal already gives its new name, since Node.js before 25 then read both and failed when they
|
|
71
|
+
* differed, and so is every option of a literal with a key that can't be read, such as a spread,
|
|
72
|
+
* a computed key or a method, which could give either name.
|
|
73
|
+
*/
|
|
74
|
+
function renameOptions(options: J.NewClass): J.NewClass {
|
|
75
|
+
const members = options.body?.statements ?? [];
|
|
76
|
+
const names = members.map(member => member.element.kind === JS.Kind.PropertyAssignment
|
|
77
|
+
? propertyNameOf(member.element as JS.PropertyAssignment)
|
|
78
|
+
: undefined);
|
|
79
|
+
if (names.some(name => name === undefined)) {
|
|
80
|
+
return options;
|
|
81
|
+
}
|
|
82
|
+
let renamed = false;
|
|
83
|
+
const statements = members.map((member, i) => {
|
|
84
|
+
const to = RENAMED.get(names[i]!);
|
|
85
|
+
if (!to || names.includes(to)) {
|
|
86
|
+
return member;
|
|
87
|
+
}
|
|
88
|
+
renamed = true;
|
|
89
|
+
return {...member, element: renameProperty(member.element as JS.PropertyAssignment, to)};
|
|
90
|
+
});
|
|
91
|
+
return renamed ? {...options, body: {...options.body!, statements}} : options;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function renameProperty(property: JS.PropertyAssignment, to: string): JS.PropertyAssignment {
|
|
95
|
+
const key = property.name.element;
|
|
96
|
+
if (isIdentifier(key)) {
|
|
97
|
+
const renamedKey = {...key, simpleName: to, fieldType: undefined};
|
|
98
|
+
if (property.initializer) {
|
|
99
|
+
return {...property, name: {...property.name, element: renamedKey}};
|
|
100
|
+
}
|
|
101
|
+
// `{hash}` becomes `{hashAlgorithm: hash}`, which still reads the variable.
|
|
102
|
+
return {
|
|
103
|
+
...property,
|
|
104
|
+
name: {...property.name, element: {...renamedKey, id: randomId()}},
|
|
105
|
+
assigmentToken: JS.PropertyAssignment.Token.Colon,
|
|
106
|
+
initializer: {...key, prefix: space(' ')}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
// A quoted key keeps its quotes.
|
|
110
|
+
const literal = key as J.Literal;
|
|
111
|
+
const quote = literal.valueSource?.charAt(0) ?? "'";
|
|
112
|
+
return {
|
|
113
|
+
...property,
|
|
114
|
+
name: {
|
|
115
|
+
...property.name,
|
|
116
|
+
element: {...literal, value: to, valueSource: `${quote}${to}${quote}`, unicodeEscapes: undefined} as J.Literal
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
import {check, ExecutionContext, foundSearchResult, or, Recipe, TreeVisitor} from "@openrewrite/rewrite";
|
|
7
|
+
import {JavaScriptVisitor, JS, MethodMatcher, usesMethod} from "@openrewrite/rewrite/javascript";
|
|
8
|
+
import {isIdentifier, J} from "@openrewrite/rewrite/java";
|
|
9
|
+
import {propertyNameOf} from "./fs-extra/fs-extra-support";
|
|
10
|
+
import {optionsLiteral} from "./options-literal";
|
|
11
|
+
|
|
12
|
+
interface RmdirForm {
|
|
13
|
+
pattern: string;
|
|
14
|
+
api: string;
|
|
15
|
+
/** How the call reports the option since Node.js 25. */
|
|
16
|
+
fails: string;
|
|
17
|
+
/** How the call reported a path that is not a directory before. */
|
|
18
|
+
failed: string;
|
|
19
|
+
/** The `fs.rm()` call that removes a directory tree the same way. */
|
|
20
|
+
rm: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const RMDIR_FORMS: RmdirForm[] = [
|
|
24
|
+
{
|
|
25
|
+
pattern: "fs rmdir(..)", api: "fs.rmdir()", fails: "throws", failed: "failed with",
|
|
26
|
+
rm: "fs.rm(path, { recursive: true }, callback)"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
pattern: "fs rmdirSync(..)", api: "fs.rmdirSync()", fails: "throws", failed: "threw",
|
|
30
|
+
rm: "fs.rmSync(path, { recursive: true })"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
pattern: "fs/promises rmdir(..)", api: "fs.promises.rmdir()", fails: "rejects with", failed: "rejected with",
|
|
34
|
+
rm: "fs.promises.rm(path, { recursive: true })"
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
export class FindFsRmdirRecursive extends Recipe {
|
|
39
|
+
readonly name = "org.openrewrite.node.migrate.fs.find-rmdir-recursive"
|
|
40
|
+
readonly displayName: string = "Find `fs.rmdir()` calls with the removed `recursive` option";
|
|
41
|
+
readonly description: string = "Node.js 25 removed the `recursive` option of `fs.rmdir()`, `fs.rmdirSync()` and " +
|
|
42
|
+
"`fs.promises.rmdir()` (DEP0147), which now fail with `ERR_INVALID_ARG_VALUE` whenever it is passed, even as " +
|
|
43
|
+
"`false`. `fs.rm()` with `recursive: true` removes a directory tree the same way, but it is not an " +
|
|
44
|
+
"exact replacement: it deletes a file where `fs.rmdir()` failed with `ENOTDIR`, and with `force: true`, as Node.js " +
|
|
45
|
+
"suggests, it also ignores a missing path. So the calls are marked to be changed by hand. Only options written " +
|
|
46
|
+
"as an object literal are found.";
|
|
47
|
+
readonly tags: string[] = ["DEP0147"];
|
|
48
|
+
|
|
49
|
+
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
50
|
+
return check(or(...RMDIR_FORMS.map(form => usesMethod(form.pattern))), new class extends JavaScriptVisitor<ExecutionContext> {
|
|
51
|
+
forms = RMDIR_FORMS.map(form => ({form, matcher: new MethodMatcher(form.pattern)}));
|
|
52
|
+
|
|
53
|
+
protected async visitMethodInvocation(m: J.MethodInvocation, p: ExecutionContext): Promise<J | undefined> {
|
|
54
|
+
const method = await super.visitMethodInvocation(m, p) as J.MethodInvocation;
|
|
55
|
+
const form = this.forms.find(f => f.matcher.matches(method.methodType))?.form;
|
|
56
|
+
const options = form && optionsLiteral(method.arguments.elements[1]?.element);
|
|
57
|
+
const recursive = options && recursiveOption(options);
|
|
58
|
+
return form && recursive ? foundSearchResult(method, message(form, recursive)) : method;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The value an options literal gives `recursive`, the last one where it gives several, or undefined
|
|
66
|
+
* where it gives none. `{recursive}` passes the variable of that name.
|
|
67
|
+
*/
|
|
68
|
+
function recursiveOption(options: J.NewClass): J | undefined {
|
|
69
|
+
let value: J | undefined;
|
|
70
|
+
for (const member of options.body?.statements ?? []) {
|
|
71
|
+
const property = member.element as JS.PropertyAssignment;
|
|
72
|
+
if (property.kind === JS.Kind.PropertyAssignment && propertyNameOf(property) === "recursive") {
|
|
73
|
+
value = property.initializer ?? property.name.element;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Node.js 25 only throws for a value other than undefined.
|
|
77
|
+
return value && !(isIdentifier(value) && value.simpleName === "undefined") ? value : undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function message(form: RmdirForm, recursive: J): string {
|
|
81
|
+
const removed = `${form.api} ${form.fails} ERR_INVALID_ARG_VALUE for the recursive option since Node.js 25`;
|
|
82
|
+
if (recursive.kind === J.Kind.Literal && (recursive as J.Literal).value === false) {
|
|
83
|
+
return `${removed}, even when it is false (DEP0147). Remove the option.`;
|
|
84
|
+
}
|
|
85
|
+
return `${removed} (DEP0147). ${form.rm} removes the directory tree as before, but deletes a file where ` +
|
|
86
|
+
`${form.api} ${form.failed} ENOTDIR, and force: true also ignores a missing path.`;
|
|
87
|
+
}
|
|
@@ -13,7 +13,7 @@ import {J, Type} from "@openrewrite/rewrite/java";
|
|
|
13
13
|
export class ReplaceFsAccessConstants extends Recipe {
|
|
14
14
|
readonly name = "org.openrewrite.node.migrate.fs.replace-fs-access-constants"
|
|
15
15
|
readonly displayName: string = "Replace deprecated `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK` with `fs.constants.*`";
|
|
16
|
-
readonly description: string = "Replace deprecated file access constants (`fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`) with their equivalents from `fs.constants`. These constants were removed in Node.js
|
|
16
|
+
readonly description: string = "Replace deprecated file access constants (`fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`) with their equivalents from `fs.constants`. These constants were removed in Node.js 25 and should be accessed through the constants namespace.";
|
|
17
17
|
readonly tags: string[] = ["DEP0176"];
|
|
18
18
|
|
|
19
19
|
async editor(): Promise<TreeVisitor<any, ExecutionContext>> {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 the original author or authors.
|
|
3
|
+
*
|
|
4
|
+
* Moderne Proprietary. Only for use by Moderne customers under the terms of a commercial contract.
|
|
5
|
+
*/
|
|
6
|
+
import {Expression, J} from "@openrewrite/rewrite/java";
|
|
7
|
+
import {JS} from "@openrewrite/rewrite/javascript";
|
|
8
|
+
import {isObjectLiteral} from "./fs-extra/fs-extra-support";
|
|
9
|
+
|
|
10
|
+
/** The expression under any parentheses and TypeScript casts (`as`, `<T>`, `satisfies`). */
|
|
11
|
+
export function withoutCasts(e: J | undefined): J | undefined {
|
|
12
|
+
for (;;) {
|
|
13
|
+
switch (e?.kind) {
|
|
14
|
+
case J.Kind.Parentheses:
|
|
15
|
+
e = (e as J.Parentheses<J>).tree.element;
|
|
16
|
+
break;
|
|
17
|
+
case JS.Kind.As:
|
|
18
|
+
e = (e as JS.As).left.element;
|
|
19
|
+
break;
|
|
20
|
+
case J.Kind.TypeCast:
|
|
21
|
+
e = (e as J.TypeCast).expression;
|
|
22
|
+
break;
|
|
23
|
+
case JS.Kind.SatisfiesExpression:
|
|
24
|
+
e = (e as JS.SatisfiesExpression).expression;
|
|
25
|
+
break;
|
|
26
|
+
default:
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The object literal an options argument is written as, under any parentheses and casts, or
|
|
34
|
+
* undefined when the argument is anything else, such as a variable.
|
|
35
|
+
*/
|
|
36
|
+
export function optionsLiteral(arg: J | undefined): J.NewClass | undefined {
|
|
37
|
+
const e = withoutCasts(arg);
|
|
38
|
+
return isObjectLiteral(e) ? e : undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** `arg` with the object literal {@link optionsLiteral} finds in it replaced by `literal`, its parentheses and casts kept. */
|
|
42
|
+
export function withOptionsLiteral(arg: J, literal: J.NewClass): J {
|
|
43
|
+
switch (arg.kind) {
|
|
44
|
+
case J.Kind.Parentheses: {
|
|
45
|
+
const parentheses = arg as J.Parentheses<J>;
|
|
46
|
+
return {
|
|
47
|
+
...parentheses,
|
|
48
|
+
tree: {...parentheses.tree, element: withOptionsLiteral(parentheses.tree.element, literal)}
|
|
49
|
+
} as J.Parentheses<J>;
|
|
50
|
+
}
|
|
51
|
+
case JS.Kind.As: {
|
|
52
|
+
const as = arg as JS.As;
|
|
53
|
+
return {...as, left: {...as.left, element: withOptionsLiteral(as.left.element, literal) as Expression}} as JS.As;
|
|
54
|
+
}
|
|
55
|
+
case J.Kind.TypeCast: {
|
|
56
|
+
const cast = arg as J.TypeCast;
|
|
57
|
+
return {...cast, expression: withOptionsLiteral(cast.expression, literal) as Expression} as J.TypeCast;
|
|
58
|
+
}
|
|
59
|
+
case JS.Kind.SatisfiesExpression: {
|
|
60
|
+
const satisfies = arg as JS.SatisfiesExpression;
|
|
61
|
+
return {...satisfies, expression: withOptionsLiteral(satisfies.expression, literal)} as JS.SatisfiesExpression;
|
|
62
|
+
}
|
|
63
|
+
default:
|
|
64
|
+
return literal;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -13,9 +13,17 @@ import {ReplaceServerResponseWriteHeader} from "./server-response-write-header";
|
|
|
13
13
|
import {FindAeadDecipherivWithoutAuthTagLength} from "./find-aead-decipheriv-without-auth-tag-length";
|
|
14
14
|
import {FindDuplexToWebType} from "./find-duplex-to-web-type";
|
|
15
15
|
import {FindModuleRegister} from "./find-module-register";
|
|
16
|
+
import {FindFsRmdirRecursive} from "./find-fs-rmdir-recursive";
|
|
17
|
+
import {ReplaceRsaPssKeyPairOptions} from "./crypto-rsa-pss-key-pair-options";
|
|
18
|
+
import {ReplaceSlowBuffer} from "./slow-buffer";
|
|
19
|
+
import {ReplaceFsAccessConstants} from "./fs-access-constants";
|
|
16
20
|
|
|
17
|
-
// Node 26 End-of-Life deprecations (
|
|
21
|
+
// Node 26 End-of-Life deprecations (includes v25 EOL)
|
|
18
22
|
const node26EolDeprecations: Recipe[] = [
|
|
23
|
+
new ReplaceSlowBuffer(), // DEP0030: SlowBuffer (v25 EOL)
|
|
24
|
+
new FindFsRmdirRecursive(), // DEP0147: fs.rmdir(path, { recursive: true }) (v25 EOL)
|
|
25
|
+
new ReplaceRsaPssKeyPairOptions(), // DEP0154: RSA-PSS hash and mgf1Hash options (v25 EOL)
|
|
26
|
+
new ReplaceFsAccessConstants(), // DEP0176: fs.F_OK, fs.R_OK, fs.W_OK, fs.X_OK (v25 EOL)
|
|
19
27
|
new ReplaceServerResponseWriteHeader(), // DEP0063: ServerResponse.writeHeader() (v26 EOL)
|
|
20
28
|
new ReplaceStreamInternalModules(), // DEP0125: legacy _stream_* modules (v26 EOL)
|
|
21
29
|
new FindAeadDecipherivWithoutAuthTagLength(), // DEP0182: short GCM auth tags (v26 EOL)
|