flipper-doctor
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -63,2 +63,3 @@ "use strict"; | ||
exports.getEnvInfo = environmentInfo_2.getEnvInfo; | ||
var watchman = require("fb-watchman"); | ||
function getHealthchecks() { | ||
@@ -88,2 +89,18 @@ var _this = this; | ||
}, | ||
{ | ||
label: 'Watchman Installed', | ||
run: function (_) { return __awaiter(_this, void 0, void 0, function () { | ||
var isAvailable; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, isWatchmanAvailable()]; | ||
case 1: | ||
isAvailable = _a.sent(); | ||
return [2 /*return*/, { | ||
hasProblem: !isAvailable, | ||
}]; | ||
} | ||
}); | ||
}); }, | ||
}, | ||
], | ||
@@ -257,1 +274,24 @@ }, | ||
} | ||
function isWatchmanAvailable() { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var client; | ||
return __generator(this, function (_a) { | ||
client = new watchman.Client(); | ||
return [2 /*return*/, new Promise(function (resolve) { | ||
var complete = function (result) { | ||
resolve(result); | ||
client.removeAllListeners('error'); | ||
client.end(); | ||
}; | ||
client.once('error', function () { return complete(false); }); | ||
client.capabilityCheck({ optional: [], required: ['relative_root'] }, function (error) { | ||
if (error) { | ||
complete(false); | ||
return; | ||
} | ||
complete(true); | ||
}); | ||
})]; | ||
}); | ||
}); | ||
} |
{ | ||
"name": "flipper-doctor", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Utility for checking for issues with a flipper installation", | ||
@@ -10,2 +10,3 @@ "main": "lib/index.js", | ||
"@types/jest": "^24.0.21", | ||
"@types/fb-watchman": "2.0.0", | ||
"@typescript-eslint/eslint-plugin": "^2.8.0", | ||
@@ -45,4 +46,5 @@ "eslint": "^6.6.0", | ||
"@types/node": "^12.12.12", | ||
"envinfo": "^7.4.0" | ||
"envinfo": "^7.4.0", | ||
"fb-watchman": "^2.0.1" | ||
} | ||
} |
30406
590
3
15
+ Addedfb-watchman@^2.0.1
+ Addedbser@2.1.1(transitive)
+ Addedfb-watchman@2.0.2(transitive)
+ Addednode-int64@0.4.0(transitive)