UNPKG

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

71 lines (53 loc) 1.6 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.getScopeRemotes = getScopeRemotes; exports.fetchRemoteVersions = fetchRemoteVersions; function _bluebird() { const data = require("bluebird"); _bluebird = function () { return data; }; return data; } function _ramda() { const data = _interopRequireDefault(require("ramda")); _ramda = function () { return data; }; return data; } function _globalRemotes() { const data = _interopRequireDefault(require("../global-config/global-remotes")); _globalRemotes = function () { return data; }; return data; } function _remotes() { const data = require("../remotes"); _remotes = function () { return data; }; return data; } function getScopeRemotes(scope) { function mergeRemotes(globalRemotes) { const globalObj = globalRemotes.toPlainObject(); return _remotes().Remotes.load(_ramda().default.merge(globalObj, scope.scopeJson.remotes)); } return _globalRemotes().default.load().then(mergeRemotes); } function fetchRemoteVersions(_x, _x2) { return _fetchRemoteVersions.apply(this, arguments); } function _fetchRemoteVersions() { _fetchRemoteVersions = (0, _bluebird().coroutine)(function* (scope, componentIds) { const externals = componentIds.filter(id => !id.isLocal(scope.name)); const remotes = yield getScopeRemotes(scope); return remotes.latestVersions(externals, scope); }); return _fetchRemoteVersions.apply(this, arguments); }