rune
Version:
CLI to upload your games to Rune
20 lines (19 loc) • 648 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function transform(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
root
.find(j.ImportDeclaration)
.filter((path) => path.node.source.value === "dusk-games-sdk/eslint.js")
.forEach((path) => {
path.node.source.value = "rune-sdk/eslint.js";
j(path).replaceWith(path.node);
});
root.find(j.Identifier, { name: "duskPlugin" }).forEach((path) => {
path.node.name = "runePlugin";
j(path).replaceWith(path.node);
});
return root.toSource();
}
exports.default = transform;