@rnv/engine-core
Version:
ReNative Engine Core
31 lines • 1.43 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var core_1 = require("@rnv/core");
var path_1 = tslib_1.__importDefault(require("path"));
var Question = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var c, content, confirmCreateNpmrc, npmrcPath;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if ((0, core_1.isYarnInstalled)())
return [2 /*return*/];
c = (0, core_1.getContext)();
content = 'legacy-peer-deps=true';
return [4 /*yield*/, (0, core_1.inquirerPrompt)({
name: 'confirmCreateNpmrc',
type: 'confirm',
message: "To avoid the issue with the resolving peer dependencies .npmrc file with content: \"".concat(content, "\" will be added to your project"),
})];
case 1:
confirmCreateNpmrc = (_a.sent()).confirmCreateNpmrc;
if (confirmCreateNpmrc) {
npmrcPath = path_1.default.join(c.paths.project.dir, '.npmrc');
(0, core_1.writeFileSync)(npmrcPath, content);
}
return [2 /*return*/];
}
});
}); };
exports.default = Question;
//# sourceMappingURL=resolvePeerDepsNPM.js.map
;