bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
61 lines (44 loc) • 1.25 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _bluebird() {
const data = require("bluebird");
_bluebird = function () {
return data;
};
return data;
}
function _scope() {
const data = require("../../../scope");
_scope = function () {
return data;
};
return data;
}
function _scopeGraph() {
const data = _interopRequireDefault(require("../../../scope/graph/scope-graph"));
_scopeGraph = function () {
return data;
};
return data;
}
var _default = /*#__PURE__*/function () {
var _graph = (0, _bluebird().coroutine)(function* (path, id) {
const scope = yield (0, _scope().loadScope)(path);
const dependencyGraph = yield _scopeGraph().default.loadLatest(scope);
if (!id) {
return dependencyGraph.serialize();
}
const bitId = yield scope.getParsedId(id);
const componentGraph = dependencyGraph.getSubGraphOfConnectedComponents(bitId);
return dependencyGraph.serialize(componentGraph);
});
function graph(_x, _x2) {
return _graph.apply(this, arguments);
}
return graph;
}();
exports.default = _default;
;