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

37 lines (26 loc) 1.16 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _chalk() { const data = _interopRequireDefault(require("chalk")); _chalk = function () { return data; }; return data; } var _default = results => { const reportComponents = results.map(result => { const bounds = result.bound.filter(bound => bound.from && bound.to).map(bound => `\t\toriginal path: ${_chalk().default.bold(bound.from)}, link path: ${_chalk().default.bold(bound.to)}`).join('\n'); if (!bounds.length) { const reason = result.id.scope ? 'is a nested dependency' : 'was not exported yet'; return _chalk().default.cyan(`\t${result.id.toString()}:\n\t\tnothing to link because the component ${reason}`); } return _chalk().default.cyan(`\t${result.id.toString()}:\n ${bounds}`); }).join('\n'); const reportTitle = _chalk().default.underline(`linked ${_chalk().default.bold(results.length.toString())} components\n`); return reportTitle + reportComponents; }; exports.default = _default;