prismixer
Version:
Allow you to create multiple Prisma schema files
37 lines • 1.85 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
const command_1 = require("@oclif/command");
const path_1 = __importDefault(require("path"));
const util_1 = require("util");
const jsonfile_1 = __importDefault(require("jsonfile"));
const prismixer_1 = require("./prismixer");
const readJsonFile = (0, util_1.promisify)(jsonfile_1.default.readFile);
class Prismixer extends command_1.Command {
run() {
return __awaiter(this, void 0, void 0, function* () {
this.log(`Prismixer: mixing your schemas...`);
const options = (yield readJsonFile(path_1.default.join(process.cwd(), "prismixer.config.json")));
if (!options.output)
options.output = "prisma/schema.prisma";
yield (0, prismixer_1.prismixer)(options);
});
}
}
Prismixer.description = "Allows you to have multiple Prisma schema files";
Prismixer.flags = {
version: command_1.flags.version({ char: "v" }),
help: command_1.flags.help({ char: "h" }),
};
module.exports = Prismixer;
//# sourceMappingURL=index.js.map