@pnpm/default-reporter
Advanced tools
Comparing version
# @pnpm/default-reporter | ||
## 8.0.0 | ||
### Major Changes | ||
- 97b986fbc: Node.js 10 support is dropped. At least Node.js 12.17 is required for the package to work. | ||
### Minor Changes | ||
- 90487a3a8: Print a notification about newer version of the CLI. | ||
### Patch Changes | ||
- Updated dependencies [97b986fbc] | ||
- Updated dependencies [90487a3a8] | ||
- Updated dependencies [78470a32d] | ||
- Updated dependencies [aed712455] | ||
- Updated dependencies [aed712455] | ||
- @pnpm/config@12.0.0 | ||
- @pnpm/core-loggers@6.0.0 | ||
- @pnpm/error@2.0.0 | ||
- @pnpm/types@7.0.0 | ||
## 7.10.7 | ||
@@ -4,0 +26,0 @@ |
@@ -28,2 +28,3 @@ "use strict"; | ||
const operators_1 = require("rxjs/operators"); | ||
const ansi_diff_1 = __importDefault(require("ansi-diff")); | ||
const constants_1 = require("./constants"); | ||
@@ -35,3 +36,2 @@ const mergeOutputs_1 = __importDefault(require("./mergeOutputs")); | ||
const reporterForServer_1 = __importDefault(require("./reporterForServer")); | ||
const createDiffer = require("ansi-diff"); | ||
function default_1(opts) { | ||
@@ -42,3 +42,3 @@ var _a, _b, _c, _d; | ||
const log$ = Rx.fromEvent(opts.streamParser, 'data'); | ||
reporterForServer_1.default(log$, opts.context.config); | ||
(0, reporterForServer_1.default)(log$, opts.context.config); | ||
return; | ||
@@ -57,3 +57,3 @@ } | ||
} | ||
const diff = createDiffer({ | ||
const diff = (0, ansi_diff_1.default)({ | ||
height: process.stdout.rows, | ||
@@ -100,2 +100,3 @@ outputMaxWidth, | ||
const requestRetryPushStream = new Rx.Subject(); | ||
const updateCheckPushStream = new Rx.Subject(); | ||
setTimeout(() => { | ||
@@ -158,2 +159,5 @@ opts.streamParser['on']('data', (log) => { | ||
break; | ||
case 'pnpm:update-check': | ||
updateCheckPushStream.next(log); | ||
break; | ||
case 'pnpm': // eslint-disable-line | ||
@@ -188,4 +192,5 @@ case 'pnpm:global': // eslint-disable-line | ||
summary: Rx.from(summaryPushStream), | ||
updateCheck: Rx.from(updateCheckPushStream), | ||
}; | ||
const outputs = reporterForClient_1.default(log$, { | ||
const outputs = (0, reporterForClient_1.default)(log$, { | ||
appendOnly: (_a = opts.reportingOptions) === null || _a === void 0 ? void 0 : _a.appendOnly, | ||
@@ -203,7 +208,7 @@ cmd: opts.context.argv[0], | ||
return Rx.merge(...outputs) | ||
.pipe(operators_1.map((log) => log.pipe(operators_1.map((msg) => msg.msg))), operators_1.mergeAll()); | ||
.pipe((0, operators_1.map)((log) => log.pipe((0, operators_1.map)((msg) => msg.msg))), (0, operators_1.mergeAll)()); | ||
} | ||
return mergeOutputs_1.default(outputs); | ||
return (0, mergeOutputs_1.default)(outputs); | ||
} | ||
exports.toOutput$ = toOutput$; | ||
//# sourceMappingURL=index.js.map |
@@ -22,5 +22,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const constants_1 = require("./constants"); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const constants_1 = require("./constants"); | ||
function mergeOutputs(outputs) { | ||
@@ -31,6 +31,6 @@ let blockNo = 0; | ||
let previousOuput = null; | ||
return Rx.merge(...outputs).pipe(operators_1.map((log) => { | ||
return Rx.merge(...outputs).pipe((0, operators_1.map)((log) => { | ||
let currentBlockNo = -1; | ||
let currentFixedBlockNo = -1; | ||
return log.pipe(operators_1.map((msg) => { | ||
return log.pipe((0, operators_1.map)((msg) => { | ||
if (msg['fixed']) { | ||
@@ -56,3 +56,3 @@ if (currentFixedBlockNo === -1) { | ||
})); | ||
}), operators_1.mergeAll(), operators_1.scan((acc, log) => { | ||
}), (0, operators_1.mergeAll)(), (0, operators_1.scan)((acc, log) => { | ||
if (log.fixed) { | ||
@@ -66,6 +66,6 @@ acc.fixedBlocks[log.blockNo] = log.msg; | ||
return acc; | ||
}, { fixedBlocks: [], blocks: [] }), operators_1.map((sections) => { | ||
}, { fixedBlocks: [], blocks: [] }), (0, operators_1.map)((sections) => { | ||
const fixedBlocks = sections.fixedBlocks.filter(Boolean); | ||
const nonFixedPart = sections.blocks.filter(Boolean).join(constants_1.EOL); | ||
if (!fixedBlocks.length) { | ||
if (fixedBlocks.length === 0) { | ||
return nonFixedPart; | ||
@@ -78,3 +78,3 @@ } | ||
return `${nonFixedPart}${constants_1.EOL}${fixedPart}`; | ||
}), operators_1.filter((msg) => { | ||
}), (0, operators_1.filter)((msg) => { | ||
if (started) { | ||
@@ -87,3 +87,3 @@ return true; | ||
return true; | ||
}), operators_1.filter((msg) => { | ||
}), (0, operators_1.filter)((msg) => { | ||
if (msg !== previousOuput) { | ||
@@ -90,0 +90,0 @@ previousOuput = msg; |
@@ -25,2 +25,3 @@ import { Config } from '@pnpm/config'; | ||
packageImportMethod: Rx.Observable<logs.PackageImportMethodLog>; | ||
updateCheck: Rx.Observable<logs.UpdateCheckLog>; | ||
}, opts: { | ||
@@ -27,0 +28,0 @@ appendOnly?: boolean; |
@@ -20,2 +20,3 @@ "use strict"; | ||
const reportSummary_1 = __importDefault(require("./reportSummary")); | ||
const reportUpdateCheck_1 = __importDefault(require("./reportUpdateCheck")); | ||
function default_1(log$, opts) { | ||
@@ -26,10 +27,10 @@ var _a, _b, _c, _d; | ||
const throttle = typeof opts.throttleProgress === 'number' && opts.throttleProgress > 0 | ||
? operators_1.throttleTime(opts.throttleProgress, undefined, { leading: true, trailing: true }) | ||
? (0, operators_1.throttleTime)(opts.throttleProgress, undefined, { leading: true, trailing: true }) | ||
: undefined; | ||
const outputs = [ | ||
reportProgress_1.default(log$, { | ||
(0, reportProgress_1.default)(log$, { | ||
cwd, | ||
throttle, | ||
}), | ||
reportLifecycleScripts_1.default(log$, { | ||
(0, reportLifecycleScripts_1.default)(log$, { | ||
appendOnly: opts.appendOnly === true || opts.streamLifecycleOutput, | ||
@@ -39,4 +40,4 @@ cwd, | ||
}), | ||
reportDeprecations_1.default(log$.deprecation, { cwd, isRecursive: opts.isRecursive }), | ||
reportMisc_1.default(log$, { | ||
(0, reportDeprecations_1.default)(log$.deprecation, { cwd, isRecursive: opts.isRecursive }), | ||
(0, reportMisc_1.default)(log$, { | ||
config: opts.config, | ||
@@ -47,3 +48,3 @@ cwd, | ||
}), | ||
...reportStats_1.default(log$, { | ||
...(0, reportStats_1.default)(log$, { | ||
cmd: opts.cmd, | ||
@@ -54,14 +55,15 @@ cwd, | ||
}), | ||
reportInstallChecks_1.default(log$.installCheck, { cwd }), | ||
reportRequestRetry_1.default(log$.requestRetry), | ||
reportScope_1.default(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }), | ||
reportSkippedOptionalDependencies_1.default(log$.skippedOptionalDependency, { cwd }), | ||
reportHooks_1.default(log$.hook, { cwd, isRecursive: opts.isRecursive }), | ||
reportContext_1.default(log$, { cwd }), | ||
(0, reportInstallChecks_1.default)(log$.installCheck, { cwd }), | ||
(0, reportRequestRetry_1.default)(log$.requestRetry), | ||
(0, reportScope_1.default)(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }), | ||
(0, reportSkippedOptionalDependencies_1.default)(log$.skippedOptionalDependency, { cwd }), | ||
(0, reportHooks_1.default)(log$.hook, { cwd, isRecursive: opts.isRecursive }), | ||
(0, reportContext_1.default)(log$, { cwd }), | ||
(0, reportUpdateCheck_1.default)(log$.updateCheck), | ||
]; | ||
if (!opts.appendOnly) { | ||
outputs.push(reportBigTarballsProgress_1.default(log$)); | ||
outputs.push((0, reportBigTarballsProgress_1.default)(log$)); | ||
} | ||
if (!opts.isRecursive) { | ||
outputs.push(reportSummary_1.default(log$, { | ||
outputs.push((0, reportSummary_1.default)(log$, { | ||
cwd, | ||
@@ -68,0 +70,0 @@ pnpmConfig: opts.pnpmConfig, |
@@ -1,2 +0,2 @@ | ||
import chalk = require('chalk'); | ||
import chalk from 'chalk'; | ||
export declare const PREFIX_MAX_LENGTH = 40; | ||
@@ -3,0 +3,0 @@ export declare const hlValue: chalk.Chalk; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.REMOVED_CHAR = exports.ADDED_CHAR = exports.hlPkgId = exports.hlValue = exports.PREFIX_MAX_LENGTH = void 0; | ||
const chalk = require("chalk"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
exports.PREFIX_MAX_LENGTH = 40; | ||
exports.hlValue = chalk.cyanBright; | ||
exports.hlPkgId = chalk['whiteBright']; | ||
exports.ADDED_CHAR = chalk.green('+'); | ||
exports.REMOVED_CHAR = chalk.red('-'); | ||
exports.hlValue = chalk_1.default.cyanBright; | ||
exports.hlPkgId = chalk_1.default['whiteBright']; | ||
exports.ADDED_CHAR = chalk_1.default.green('+'); | ||
exports.REMOVED_CHAR = chalk_1.default.red('-'); | ||
//# sourceMappingURL=outputConstants.js.map |
@@ -25,3 +25,3 @@ "use strict"; | ||
const operators_1 = require("rxjs/operators"); | ||
const R = require("ramda"); | ||
const R = __importStar(require("ramda")); | ||
exports.propertyByDependencyType = { | ||
@@ -36,8 +36,8 @@ dev: 'devDependencies', | ||
const deprecationSet$ = log$.deprecation | ||
.pipe(operators_1.filter((log) => log.prefix === opts.prefix), operators_1.scan((acc, log) => { | ||
.pipe((0, operators_1.filter)((log) => log.prefix === opts.prefix), (0, operators_1.scan)((acc, log) => { | ||
acc.add(log.pkgId); | ||
return acc; | ||
}, new Set()), operators_1.startWith(new Set())); | ||
const filterPrefix = operators_1.filter((log) => log.prefix === opts.prefix); | ||
const pkgsDiff$ = Rx.combineLatest(log$.root.pipe(filterPrefix), deprecationSet$).pipe(operators_1.scan((pkgsDiff, args) => { | ||
}, new Set()), (0, operators_1.startWith)(new Set())); | ||
const filterPrefix = (0, operators_1.filter)((log) => log.prefix === opts.prefix); | ||
const pkgsDiff$ = Rx.combineLatest(log$.root.pipe(filterPrefix), deprecationSet$).pipe((0, operators_1.scan)((pkgsDiff, args) => { | ||
const rootLog = args[0]; | ||
@@ -72,3 +72,3 @@ const deprecationSet = args[1]; | ||
prod: {}, | ||
}), operators_1.startWith({ | ||
}), (0, operators_1.startWith)({ | ||
dev: {}, | ||
@@ -80,8 +80,8 @@ nodeModulesOnly: {}, | ||
})); | ||
const packageManifest$ = Rx.merge(log$.packageManifest.pipe(filterPrefix), log$.summary.pipe(filterPrefix, operators_1.mapTo({}))) | ||
.pipe(operators_1.take(2), operators_1.reduce(R.merge, {}) // eslint-disable-line @typescript-eslint/no-explicit-any | ||
const packageManifest$ = Rx.merge(log$.packageManifest.pipe(filterPrefix), log$.summary.pipe(filterPrefix, (0, operators_1.mapTo)({}))) | ||
.pipe((0, operators_1.take)(2), (0, operators_1.reduce)(R.merge, {}) // eslint-disable-line @typescript-eslint/no-explicit-any | ||
); | ||
return Rx.combineLatest(pkgsDiff$, packageManifest$) | ||
.pipe(operators_1.map(([pkgsDiff, packageManifests]) => { | ||
if (!packageManifests['initial'] || !packageManifests['updated']) | ||
.pipe((0, operators_1.map)(([pkgsDiff, packageManifests]) => { | ||
if ((packageManifests['initial'] == null) || (packageManifests['updated'] == null)) | ||
return pkgsDiff; | ||
@@ -120,3 +120,3 @@ const initialPackageManifest = removeOptionalFromProdDeps(packageManifests['initial']); | ||
function removeOptionalFromProdDeps(pkg) { | ||
if (!pkg.dependencies || !pkg.optionalDependencies) | ||
if ((pkg.dependencies == null) || (pkg.optionalDependencies == null)) | ||
return pkg; | ||
@@ -123,0 +123,0 @@ for (const depName of Object.keys(pkg.dependencies)) { |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const operators_1 = require("rxjs/operators"); | ||
const pretty_bytes_1 = __importDefault(require("pretty-bytes")); | ||
const outputConstants_1 = require("./outputConstants"); | ||
const prettyBytes = require("pretty-bytes"); | ||
const BIG_TARBALL_SIZE = 1024 * 1024 * 5; // 5 MB | ||
exports.default = (log$) => { | ||
return log$.fetchingProgress.pipe(operators_1.filter((log) => log.status === 'started' && | ||
return log$.fetchingProgress.pipe((0, operators_1.filter)((log) => log.status === 'started' && | ||
typeof log.size === 'number' && log.size >= BIG_TARBALL_SIZE && | ||
// When retrying the download, keep the existing progress line. | ||
// Fixing issue: https://github.com/pnpm/pnpm/issues/1013 | ||
log.attempt === 1), operators_1.map((startedLog) => { | ||
const size = prettyBytes(startedLog['size']); | ||
return log$.fetchingProgress.pipe(operators_1.filter((log) => log.status === 'in_progress' && log.packageId === startedLog['packageId']), operators_1.map((log) => log['downloaded']), operators_1.startWith(0), operators_1.map((downloadedRaw) => { | ||
log.attempt === 1), (0, operators_1.map)((startedLog) => { | ||
const size = (0, pretty_bytes_1.default)(startedLog['size']); | ||
return log$.fetchingProgress.pipe((0, operators_1.filter)((log) => log.status === 'in_progress' && log.packageId === startedLog['packageId']), (0, operators_1.map)((log) => log['downloaded']), (0, operators_1.startWith)(0), (0, operators_1.map)((downloadedRaw) => { | ||
const done = startedLog['size'] === downloadedRaw; | ||
const downloaded = prettyBytes(downloadedRaw); | ||
const downloaded = (0, pretty_bytes_1.default)(downloadedRaw); | ||
return { | ||
fixed: !done, | ||
msg: `Downloading ${outputConstants_1.hlPkgId(startedLog['packageId'])}: ${outputConstants_1.hlValue(downloaded)}/${outputConstants_1.hlValue(size)}${done ? ', done' : ''}`, | ||
msg: `Downloading ${(0, outputConstants_1.hlPkgId)(startedLog['packageId'])}: ${(0, outputConstants_1.hlValue)(downloaded)}/${(0, outputConstants_1.hlValue)(size)}${done ? ', done' : ''}`, | ||
}; | ||
@@ -21,0 +24,0 @@ })); |
@@ -21,10 +21,13 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const normalize = require("normalize-path"); | ||
const path = require("path"); | ||
const normalize_path_1 = __importDefault(require("normalize-path")); | ||
exports.default = (log$, opts) => { | ||
return Rx.combineLatest(log$.context.pipe(operators_1.take(1)), log$.packageImportMethod.pipe(operators_1.take(1))) | ||
.pipe(operators_1.map(([context, packageImportMethod]) => { | ||
return Rx.combineLatest(log$.context.pipe((0, operators_1.take)(1)), log$.packageImportMethod.pipe((0, operators_1.take)(1))) | ||
.pipe((0, operators_1.map)(([context, packageImportMethod]) => { | ||
if (context.currentLockfileExists) { | ||
@@ -52,3 +55,3 @@ return Rx.NEVER; | ||
Content-addressable store is at: ${context.storeDir} | ||
Virtual store is at: ${normalize(path.relative(opts.cwd, context.virtualStoreDir))}`, | ||
Virtual store is at: ${(0, normalize_path_1.default)(path_1.default.relative(opts.cwd, context.virtualStoreDir))}`, | ||
}); | ||
@@ -55,0 +58,0 @@ })); |
@@ -27,16 +27,16 @@ "use strict"; | ||
const operators_1 = require("rxjs/operators"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const formatWarn_1 = __importDefault(require("./utils/formatWarn")); | ||
const zooming_1 = require("./utils/zooming"); | ||
const chalk = require("chalk"); | ||
exports.default = (deprecation$, opts) => { | ||
return deprecation$.pipe( | ||
// print warnings only about deprecated packages from the root | ||
operators_1.filter((log) => log.depth === 0), operators_1.map((log) => { | ||
(0, operators_1.filter)((log) => log.depth === 0), (0, operators_1.map)((log) => { | ||
if (!opts.isRecursive && log.prefix === opts.cwd) { | ||
return Rx.of({ | ||
msg: formatWarn_1.default(`${chalk.red('deprecated')} ${log.pkgName}@${log.pkgVersion}: ${log.deprecated}`), | ||
msg: (0, formatWarn_1.default)(`${chalk_1.default.red('deprecated')} ${log.pkgName}@${log.pkgVersion}: ${log.deprecated}`), | ||
}); | ||
} | ||
return Rx.of({ | ||
msg: zooming_1.zoomOut(opts.cwd, log.prefix, formatWarn_1.default(`${chalk.red('deprecated')} ${log.pkgName}@${log.pkgVersion}`)), | ||
msg: (0, zooming_1.zoomOut)(opts.cwd, log.prefix, (0, formatWarn_1.default)(`${chalk_1.default.red('deprecated')} ${log.pkgName}@${log.pkgVersion}`)), | ||
}); | ||
@@ -43,0 +43,0 @@ })); |
@@ -21,10 +21,13 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const zooming_1 = require("./utils/zooming"); | ||
const chalk = require("chalk"); | ||
exports.default = (hook$, opts) => { | ||
return hook$.pipe(operators_1.map((log) => Rx.of({ | ||
msg: zooming_1.autozoom(opts.cwd, log.prefix, `${chalk.magentaBright(log.hook)}: ${log.message}`, { | ||
return hook$.pipe((0, operators_1.map)((log) => Rx.of({ | ||
msg: (0, zooming_1.autozoom)(opts.cwd, log.prefix, `${chalk_1.default.magentaBright(log.hook)}: ${log.message}`, { | ||
zoomOutCurrent: opts.isRecursive, | ||
@@ -31,0 +34,0 @@ }), |
@@ -30,3 +30,3 @@ "use strict"; | ||
exports.default = (installCheck$, opts) => { | ||
return installCheck$.pipe(operators_1.map((log) => formatInstallCheck(opts.cwd, log)), operators_1.filter(Boolean), operators_1.map((msg) => Rx.of({ msg }))); | ||
return installCheck$.pipe((0, operators_1.map)((log) => formatInstallCheck(opts.cwd, log)), (0, operators_1.filter)(Boolean), (0, operators_1.map)((msg) => Rx.of({ msg }))); | ||
}; | ||
@@ -38,5 +38,5 @@ function formatInstallCheck(currentPrefix, logObj, opts) { | ||
case 'EBADPLATFORM': | ||
return zooming_1.autozoom(currentPrefix, logObj['prefix'], formatWarn_1.default(`Unsupported system. Skipping dependency ${logObj.pkgId}`), { zoomOutCurrent }); | ||
return (0, zooming_1.autozoom)(currentPrefix, logObj['prefix'], (0, formatWarn_1.default)(`Unsupported system. Skipping dependency ${logObj.pkgId}`), { zoomOutCurrent }); | ||
case 'ENOTSUP': | ||
return zooming_1.autozoom(currentPrefix, logObj['prefix'], logObj.toString(), { zoomOutCurrent }); | ||
return (0, zooming_1.autozoom)(currentPrefix, logObj['prefix'], logObj.toString(), { zoomOutCurrent }); | ||
default: | ||
@@ -43,0 +43,0 @@ return undefined; |
@@ -21,13 +21,16 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const pretty_ms_1 = __importDefault(require("pretty-ms")); | ||
const strip_ansi_1 = __importDefault(require("strip-ansi")); | ||
const constants_1 = require("../constants"); | ||
const formatPrefix_1 = __importStar(require("./utils/formatPrefix")); | ||
const outputConstants_1 = require("./outputConstants"); | ||
const chalk = require("chalk"); | ||
const path = require("path"); | ||
const prettyTime = require("pretty-ms"); | ||
const stripAnsi = require("strip-ansi"); | ||
const NODE_MODULES = `${path.sep}node_modules${path.sep}`; | ||
const NODE_MODULES = `${path_1.default.sep}node_modules${path_1.default.sep}`; | ||
// When streaming processes are spawned, use this color for prefix | ||
@@ -43,3 +46,3 @@ const colorWheel = ['cyan', 'magenta', 'blue', 'yellow', 'green', 'red']; | ||
const streamLifecycleOutput = createStreamLifecycleOutput(opts.cwd); | ||
return log$.lifecycle.pipe(operators_1.map((log) => Rx.of({ | ||
return log$.lifecycle.pipe((0, operators_1.map)((log) => Rx.of({ | ||
msg: streamLifecycleOutput(log), | ||
@@ -59,3 +62,3 @@ }))); | ||
startTime: process.hrtime(), | ||
status: formatIndentedStatus(chalk.magentaBright('Running...')), | ||
status: formatIndentedStatus(chalk_1.default.magentaBright('Running...')), | ||
}; | ||
@@ -89,3 +92,3 @@ const exit = typeof log['exitCode'] === 'number'; | ||
var _a; | ||
messageCache.label = (_a = messageCache.label) !== null && _a !== void 0 ? _a : `${highlightLastFolder(formatPrefix_1.formatPrefixNoTrim(opts.cwd, log.wd))}: Running ${log.stage} script`; | ||
messageCache.label = (_a = messageCache.label) !== null && _a !== void 0 ? _a : `${highlightLastFolder((0, formatPrefix_1.formatPrefixNoTrim)(opts.cwd, log.wd))}: Running ${log.stage} script`; | ||
if (!opts.exit) { | ||
@@ -95,3 +98,3 @@ updateMessageCache(log, messageCache, opts); | ||
} | ||
const time = prettyTime(toNano(process.hrtime(messageCache.startTime))); | ||
const time = (0, pretty_ms_1.default)(toNano(process.hrtime(messageCache.startTime))); | ||
if (log['exitCode'] === 0) { | ||
@@ -130,3 +133,3 @@ return `${messageCache.label}, done in ${time}`; | ||
if (log['script']) { | ||
const prefix = `${formatPrefix_1.default(opts.cwd, log.wd)} ${outputConstants_1.hlValue(log.stage)}`; | ||
const prefix = `${(0, formatPrefix_1.default)(opts.cwd, log.wd)} ${(0, outputConstants_1.hlValue)(log.stage)}`; | ||
const maxLineWidth = opts.maxWidth - prefix.length - 2 + ANSI_ESCAPES_LENGTH_OF_PREFIX; | ||
@@ -136,8 +139,8 @@ messageCache.script = `${prefix}$ ${cutLine(log['script'], maxLineWidth)}`; | ||
else if (opts.exit) { | ||
const time = prettyTime(toNano(process.hrtime(messageCache.startTime))); | ||
const time = (0, pretty_ms_1.default)(toNano(process.hrtime(messageCache.startTime))); | ||
if (log['exitCode'] === 0) { | ||
messageCache.status = formatIndentedStatus(chalk.magentaBright(`Done in ${time}`)); | ||
messageCache.status = formatIndentedStatus(chalk_1.default.magentaBright(`Done in ${time}`)); | ||
} | ||
else { | ||
messageCache.status = formatIndentedStatus(chalk.red(`Failed in ${time}`)); | ||
messageCache.status = formatIndentedStatus(chalk_1.default.red(`Failed in ${time}`)); | ||
} | ||
@@ -150,9 +153,9 @@ } | ||
function formatIndentedStatus(status) { | ||
return `${chalk.magentaBright('└─')} ${status}`; | ||
return `${chalk_1.default.magentaBright('└─')} ${status}`; | ||
} | ||
function highlightLastFolder(p) { | ||
const lastSlash = p.lastIndexOf('/') + 1; | ||
return `${chalk.gray(p.substr(0, lastSlash))}${p.substr(lastSlash)}`; | ||
return `${chalk_1.default.gray(p.substr(0, lastSlash))}${p.substr(lastSlash)}`; | ||
} | ||
const ANSI_ESCAPES_LENGTH_OF_PREFIX = outputConstants_1.hlValue(' ').length - 1; | ||
const ANSI_ESCAPES_LENGTH_OF_PREFIX = (0, outputConstants_1.hlValue)(' ').length - 1; | ||
function createStreamLifecycleOutput(cwd) { | ||
@@ -180,3 +183,3 @@ currentColor = 0; | ||
function formatIndentedOutput(maxWidth, logObj) { | ||
return `${chalk.magentaBright('│')} ${formatLine(maxWidth - 2, logObj)}`; | ||
return `${chalk_1.default.magentaBright('│')} ${formatLine(maxWidth - 2, logObj)}`; | ||
} | ||
@@ -186,7 +189,7 @@ function formatLifecycleScriptPrefix(colorByPkg, cwd, wd, stage) { | ||
const colorName = colorWheel[currentColor % NUM_COLORS]; | ||
colorByPkg.set(wd, chalk[colorName]); | ||
colorByPkg.set(wd, chalk_1.default[colorName]); | ||
currentColor += 1; | ||
} | ||
const color = colorByPkg.get(wd); | ||
return `${color(formatPrefix_1.default(cwd, wd))} ${outputConstants_1.hlValue(stage)}`; | ||
return `${color((0, formatPrefix_1.default)(cwd, wd))} ${(0, outputConstants_1.hlValue)(stage)}`; | ||
} | ||
@@ -197,3 +200,3 @@ function formatLine(maxWidth, logObj) { | ||
if (logObj['stdio'] === 'stderr') { | ||
return chalk.gray(line); | ||
return chalk_1.default.gray(line); | ||
} | ||
@@ -203,4 +206,4 @@ return line; | ||
function cutLine(line, maxLength) { | ||
return stripAnsi(line).substr(0, maxLength); | ||
return (0, strip_ansi_1.default)(line).substr(0, maxLength); | ||
} | ||
//# sourceMappingURL=reportLifecycleScripts.js.map |
@@ -25,8 +25,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const os_1 = __importDefault(require("os")); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const reportError_1 = __importDefault(require("../reportError")); | ||
const formatWarn_1 = __importDefault(require("./utils/formatWarn")); | ||
const zooming_1 = require("./utils/zooming"); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const os = require("os"); | ||
// eslint-disable:object-literal-sort-keys | ||
@@ -45,5 +45,4 @@ const LOG_LEVEL_NUMBER = { | ||
const reportWarning = makeWarningReporter(opts); | ||
return Rx.merge(log$.registry, log$.other).pipe(operators_1.filter((obj) => LOG_LEVEL_NUMBER[obj.level] <= maxLogLevel && | ||
(obj.level !== 'info' || !obj['prefix'] || obj['prefix'] === opts.cwd)), operators_1.map((obj) => { | ||
var _a; | ||
return Rx.merge(log$.registry, log$.other).pipe((0, operators_1.filter)((obj) => LOG_LEVEL_NUMBER[obj.level] <= maxLogLevel && | ||
(obj.level !== 'info' || !obj['prefix'] || obj['prefix'] === opts.cwd)), (0, operators_1.map)((obj) => { | ||
switch (obj.level) { | ||
@@ -54,8 +53,8 @@ case 'warn': { | ||
case 'error': | ||
if (((_a = obj['message']) === null || _a === void 0 ? void 0 : _a['prefix']) && obj['message']['prefix'] !== opts.cwd) { | ||
if (obj['prefix'] && obj['prefix'] !== opts.cwd) { | ||
return Rx.of({ | ||
msg: `${obj['message']['prefix']}:` + os.EOL + reportError_1.default(obj, opts.config), | ||
msg: `${obj['prefix']}:` + os_1.default.EOL + (0, reportError_1.default)(obj, opts.config), | ||
}); | ||
} | ||
return Rx.of({ msg: reportError_1.default(obj, opts.config) }); | ||
return Rx.of({ msg: (0, reportError_1.default)(obj, opts.config) }); | ||
default: | ||
@@ -76,5 +75,5 @@ return Rx.of({ msg: obj['message'] }); | ||
if (warningsCounter <= MAX_SHOWN_WARNINGS) { | ||
return Rx.of({ msg: zooming_1.autozoom(opts.cwd, obj.prefix, formatWarn_1.default(obj.message), opts) }); | ||
return Rx.of({ msg: (0, zooming_1.autozoom)(opts.cwd, obj.prefix, (0, formatWarn_1.default)(obj.message), opts) }); | ||
} | ||
const warningMsg = formatWarn_1.default(`${warningsCounter - MAX_SHOWN_WARNINGS} other warnings`); | ||
const warningMsg = (0, formatWarn_1.default)(`${warningsCounter - MAX_SHOWN_WARNINGS} other warnings`); | ||
if (!collapsedWarnings) { | ||
@@ -81,0 +80,0 @@ collapsedWarnings = new Rx.Subject(); |
@@ -28,3 +28,3 @@ "use strict"; | ||
const progressOutput = throttledProgressOutput.bind(null, opts.throttle); | ||
return getModulesInstallProgress$(log$.stage, log$.progress).pipe(operators_1.map(({ importingDone$, progress$, requirer }) => { | ||
return getModulesInstallProgress$(log$.stage, log$.progress).pipe((0, operators_1.map)(({ importingDone$, progress$, requirer }) => { | ||
const output$ = progressOutput(importingDone$, progress$); | ||
@@ -34,4 +34,4 @@ if (requirer === opts.cwd) { | ||
} | ||
return output$.pipe(operators_1.map((msg) => { | ||
msg['msg'] = zooming_1.zoomOut(opts.cwd, requirer, msg['msg']); | ||
return output$.pipe((0, operators_1.map)((msg) => { | ||
msg['msg'] = (0, zooming_1.zoomOut)(opts.cwd, requirer, msg['msg']); | ||
return msg; | ||
@@ -47,7 +47,7 @@ })); | ||
// Fixing issue: https://github.com/pnpm/pnpm/issues/1028#issuecomment-364782901 | ||
.pipe(operators_1.takeWhile(([, importingDone]) => !importingDone, true)); | ||
if (throttle) { | ||
.pipe((0, operators_1.takeWhile)(([, importingDone]) => !importingDone, true)); | ||
if (throttle != null) { | ||
combinedProgress = combinedProgress.pipe(throttle); | ||
} | ||
return combinedProgress.pipe(operators_1.map(createStatusMessage)); | ||
return combinedProgress.pipe((0, operators_1.map)(createStatusMessage)); | ||
} | ||
@@ -82,3 +82,3 @@ function getModulesInstallProgress$(stage$, progress$) { | ||
return stage$ | ||
.pipe(operators_1.filter((log) => log.stage === 'importing_done'), operators_1.mapTo(true), operators_1.take(1), operators_1.startWith(false)); | ||
.pipe((0, operators_1.filter)((log) => log.stage === 'importing_done'), (0, operators_1.mapTo)(true), (0, operators_1.take)(1), (0, operators_1.startWith)(false)); | ||
} | ||
@@ -121,3 +121,3 @@ function getProgessStatsPushStreamByRequirer(progress$) { | ||
function createStatusMessage([progress, importingDone]) { | ||
const msg = `Progress: resolved ${outputConstants_1.hlValue(progress.resolved.toString())}, reused ${outputConstants_1.hlValue(progress.reused.toString())}, downloaded ${outputConstants_1.hlValue(progress.fetched.toString())}, added ${outputConstants_1.hlValue(progress.imported.toString())}`; | ||
const msg = `Progress: resolved ${(0, outputConstants_1.hlValue)(progress.resolved.toString())}, reused ${(0, outputConstants_1.hlValue)(progress.reused.toString())}, downloaded ${(0, outputConstants_1.hlValue)(progress.fetched.toString())}, added ${(0, outputConstants_1.hlValue)(progress.imported.toString())}`; | ||
if (importingDone) { | ||
@@ -124,0 +124,0 @@ return { |
@@ -27,6 +27,6 @@ "use strict"; | ||
const operators_1 = require("rxjs/operators"); | ||
const pretty_ms_1 = __importDefault(require("pretty-ms")); | ||
const formatWarn_1 = __importDefault(require("./utils/formatWarn")); | ||
const prettyMilliseconds = require("pretty-ms"); | ||
exports.default = (requestRetry$) => { | ||
return requestRetry$.pipe(operators_1.map((log) => { | ||
return requestRetry$.pipe((0, operators_1.map)((log) => { | ||
const retriesLeft = log.maxRetries - log.attempt + 1; | ||
@@ -36,7 +36,7 @@ const errorCode = log.error['httpStatusCode'] || log.error['status'] || log.error['errno'] || log.error['code']; | ||
const msg = `${log.method} ${log.url} error (${errorCode}). \ | ||
Will retry in ${prettyMilliseconds(log.timeout, { verbose: true })}. \ | ||
Will retry in ${(0, pretty_ms_1.default)(log.timeout, { verbose: true })}. \ | ||
${retriesLeft} retries left.`; | ||
return Rx.of({ msg: formatWarn_1.default(msg) }); | ||
return Rx.of({ msg: (0, formatWarn_1.default)(msg) }); | ||
})); | ||
}; | ||
//# sourceMappingURL=reportRequestRetry.js.map |
@@ -39,3 +39,3 @@ "use strict"; | ||
} | ||
return scope$.pipe(operators_1.take(1), operators_1.map((log) => { | ||
return scope$.pipe((0, operators_1.take)(1), (0, operators_1.map)((log) => { | ||
if (log.selected === 1) { | ||
@@ -42,0 +42,0 @@ return Rx.NEVER; |
@@ -25,3 +25,3 @@ "use strict"; | ||
exports.default = (skippedOptionalDependency$, opts) => { | ||
return skippedOptionalDependency$.pipe(operators_1.filter((log) => Boolean(log['prefix'] === opts.cwd && log.parents && log.parents.length === 0)), operators_1.map((log) => Rx.of({ | ||
return skippedOptionalDependency$.pipe((0, operators_1.filter)((log) => Boolean(log['prefix'] === opts.cwd && log.parents && log.parents.length === 0)), (0, operators_1.map)((log) => Rx.of({ | ||
msg: `info: ${ | ||
@@ -28,0 +28,0 @@ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions |
@@ -21,15 +21,18 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const R = __importStar(require("ramda")); | ||
const string_length_1 = __importDefault(require("string-length")); | ||
const constants_1 = require("../constants"); | ||
const outputConstants_1 = require("./outputConstants"); | ||
const zooming_1 = require("./utils/zooming"); | ||
const chalk = require("chalk"); | ||
const R = require("ramda"); | ||
const stringLength = require("string-length"); | ||
exports.default = (log$, opts) => { | ||
const stats$ = opts.isRecursive | ||
? log$.stats | ||
: log$.stats.pipe(operators_1.filter((log) => log.prefix !== opts.cwd)); | ||
: log$.stats.pipe((0, operators_1.filter)((log) => log.prefix !== opts.cwd)); | ||
const outputs = [ | ||
@@ -52,3 +55,3 @@ statsForNotCurrentPackage(stats$, { | ||
function statsForCurrentPackage(stats$, opts) { | ||
return stats$.pipe(operators_1.filter((log) => log.prefix === opts.currentPrefix), operators_1.take((opts.cmd === 'install' || opts.cmd === 'install-test' || opts.cmd === 'add' || opts.cmd === 'update') ? 2 : 1), operators_1.reduce((acc, log) => { | ||
return stats$.pipe((0, operators_1.filter)((log) => log.prefix === opts.currentPrefix), (0, operators_1.take)((opts.cmd === 'install' || opts.cmd === 'install-test' || opts.cmd === 'add' || opts.cmd === 'update') ? 2 : 1), (0, operators_1.reduce)((acc, log) => { | ||
if (typeof log['added'] === 'number') { | ||
@@ -61,3 +64,3 @@ acc['added'] = log['added']; | ||
return acc; | ||
}, {}), operators_1.map((stats) => { | ||
}, {}), (0, operators_1.map)((stats) => { | ||
if (!stats['removed'] && !stats['added']) { | ||
@@ -72,7 +75,7 @@ if (opts.cmd === 'link') { | ||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions | ||
msg += ' ' + chalk.green(`+${stats['added'].toString()}`); | ||
msg += ' ' + chalk_1.default.green(`+${stats['added'].toString()}`); | ||
} | ||
if (stats['removed']) { | ||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions | ||
msg += ' ' + chalk.red(`-${stats['removed'].toString()}`); | ||
msg += ' ' + chalk_1.default.red(`-${stats['removed'].toString()}`); | ||
} | ||
@@ -86,3 +89,3 @@ msg += constants_1.EOL + printPlusesAndMinuses(opts.width, (stats['added'] || 0), (stats['removed'] || 0)); | ||
const cookedStats$ = (opts.cmd !== 'remove' | ||
? stats$.pipe(operators_1.map((log) => { | ||
? stats$.pipe((0, operators_1.map)((log) => { | ||
// As of pnpm v2.9.0, during `pnpm recursive link`, logging of removed stats happens twice | ||
@@ -111,14 +114,14 @@ // 1. during linking | ||
: stats$); | ||
return cookedStats$.pipe(operators_1.filter((stats) => stats !== null && (stats['removed'] || stats['added'])), operators_1.map((stats) => { | ||
return cookedStats$.pipe((0, operators_1.filter)((stats) => stats !== null && (stats['removed'] || stats['added'])), (0, operators_1.map)((stats) => { | ||
const parts = []; | ||
if (stats['added']) { | ||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions | ||
parts.push(padStep(chalk.green(`+${stats['added'].toString()}`), 4)); | ||
parts.push(padStep(chalk_1.default.green(`+${stats['added'].toString()}`), 4)); | ||
} | ||
if (stats['removed']) { | ||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions | ||
parts.push(padStep(chalk.red(`-${stats['removed'].toString()}`), 4)); | ||
parts.push(padStep(chalk_1.default.red(`-${stats['removed'].toString()}`), 4)); | ||
} | ||
let msg = zooming_1.zoomOut(opts.currentPrefix, stats['prefix'], parts.join(' ')); | ||
const rest = Math.max(0, opts.width - 1 - stringLength(msg)); | ||
let msg = (0, zooming_1.zoomOut)(opts.currentPrefix, stats['prefix'], parts.join(' ')); | ||
const rest = Math.max(0, opts.width - 1 - (0, string_length_1.default)(msg)); | ||
msg += ' ' + printPlusesAndMinuses(rest, roundStats(stats['added'] || 0), roundStats(stats['removed'] || 0)); | ||
@@ -129,3 +132,3 @@ return Rx.of({ msg }); | ||
function padStep(s, step) { | ||
const sLength = stringLength(s); | ||
const sLength = (0, string_length_1.default)(s); | ||
const placeholderLength = Math.ceil(sLength / step) * step; | ||
@@ -132,0 +135,0 @@ if (sLength < placeholderLength) { |
@@ -21,17 +21,20 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const Rx = __importStar(require("rxjs")); | ||
const operators_1 = require("rxjs/operators"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const R = __importStar(require("ramda")); | ||
const semver_1 = __importDefault(require("semver")); | ||
const constants_1 = require("../constants"); | ||
const pkgsDiff_1 = __importStar(require("./pkgsDiff")); | ||
const outputConstants_1 = require("./outputConstants"); | ||
const chalk = require("chalk"); | ||
const path = require("path"); | ||
const R = require("ramda"); | ||
const semver = require("semver"); | ||
exports.default = (log$, opts) => { | ||
const pkgsDiff$ = pkgsDiff_1.default(log$, { prefix: opts.cwd }); | ||
const summaryLog$ = log$.summary.pipe(operators_1.take(1)); | ||
const pkgsDiff$ = (0, pkgsDiff_1.default)(log$, { prefix: opts.cwd }); | ||
const summaryLog$ = log$.summary.pipe((0, operators_1.take)(1)); | ||
return Rx.combineLatest(pkgsDiff$, summaryLog$) | ||
.pipe(operators_1.take(1), operators_1.map(([pkgsDiff]) => { | ||
.pipe((0, operators_1.take)(1), (0, operators_1.map)(([pkgsDiff]) => { | ||
var _a; | ||
@@ -41,9 +44,9 @@ let msg = ''; | ||
const diffs = R.values(pkgsDiff[depType]); | ||
if (diffs.length) { | ||
if (diffs.length > 0) { | ||
msg += constants_1.EOL; | ||
if ((_a = opts.pnpmConfig) === null || _a === void 0 ? void 0 : _a.global) { | ||
msg += chalk.cyanBright(`${opts.cwd}:`); | ||
msg += chalk_1.default.cyanBright(`${opts.cwd}:`); | ||
} | ||
else { | ||
msg += chalk.cyanBright(`${pkgsDiff_1.propertyByDependencyType[depType]}:`); | ||
msg += chalk_1.default.cyanBright(`${pkgsDiff_1.propertyByDependencyType[depType]}:`); | ||
} | ||
@@ -75,12 +78,12 @@ msg += constants_1.EOL; | ||
if (pkg.version) { | ||
result += ` ${chalk.grey(pkg.version)}`; | ||
if (pkg.latest && semver.lt(pkg.version, pkg.latest)) { | ||
result += ` ${chalk.grey(`(${pkg.latest} is available)`)}`; | ||
result += ` ${chalk_1.default.grey(pkg.version)}`; | ||
if (pkg.latest && semver_1.default.lt(pkg.version, pkg.latest)) { | ||
result += ` ${chalk_1.default.grey(`(${pkg.latest} is available)`)}`; | ||
} | ||
} | ||
if (pkg.deprecated) { | ||
result += ` ${chalk.red('deprecated')}`; | ||
result += ` ${chalk_1.default.red('deprecated')}`; | ||
} | ||
if (pkg.from) { | ||
result += ` ${chalk.grey(`<- ${pkg.from && path.relative(opts.prefix, pkg.from) || '???'}`)}`; | ||
result += ` ${chalk_1.default.grey(`<- ${pkg.from && path_1.default.relative(opts.prefix, pkg.from) || '???'}`)}`; | ||
} | ||
@@ -87,0 +90,0 @@ return result; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatPrefixNoTrim = void 0; | ||
const path_1 = __importDefault(require("path")); | ||
const normalize_path_1 = __importDefault(require("normalize-path")); | ||
const outputConstants_1 = require("../outputConstants"); | ||
const path = require("path"); | ||
const normalize = require("normalize-path"); | ||
function formatPrefix(cwd, prefix) { | ||
@@ -21,5 +24,5 @@ prefix = formatPrefixNoTrim(cwd, prefix); | ||
function formatPrefixNoTrim(cwd, prefix) { | ||
return normalize(path.relative(cwd, prefix) || '.'); | ||
return (0, normalize_path_1.default)(path_1.default.relative(cwd, prefix) || '.'); | ||
} | ||
exports.formatPrefixNoTrim = formatPrefixNoTrim; | ||
//# sourceMappingURL=formatPrefix.js.map |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk = require("chalk"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
function formatWarn(message) { | ||
@@ -8,5 +11,5 @@ // The \u2009 is the "thin space" unicode character | ||
// trims whitespace at the beginning | ||
return `${chalk.bgYellow.black('\u2009WARN\u2009')} ${message}`; | ||
return `${chalk_1.default.bgYellow.black('\u2009WARN\u2009')} ${message}`; | ||
} | ||
exports.default = formatWarn; | ||
//# sourceMappingURL=formatWarn.js.map |
@@ -7,5 +7,5 @@ "use strict"; | ||
exports.zoomOut = exports.autozoom = void 0; | ||
const right_pad_1 = __importDefault(require("right-pad")); | ||
const outputConstants_1 = require("../outputConstants"); | ||
const formatPrefix_1 = __importDefault(require("./formatPrefix")); | ||
const rightPad = require("right-pad"); | ||
function autozoom(currentPrefix, logPrefix, line, opts) { | ||
@@ -19,5 +19,5 @@ if (!logPrefix || !opts.zoomOutCurrent && currentPrefix === logPrefix) { | ||
function zoomOut(currentPrefix, logPrefix, line) { | ||
return `${rightPad(formatPrefix_1.default(currentPrefix, logPrefix), outputConstants_1.PREFIX_MAX_LENGTH)} | ${line}`; | ||
return `${(0, right_pad_1.default)((0, formatPrefix_1.default)(currentPrefix, logPrefix), outputConstants_1.PREFIX_MAX_LENGTH)} | ${line}`; | ||
} | ||
exports.zoomOut = zoomOut; | ||
//# sourceMappingURL=zooming.js.map |
@@ -6,4 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const reportError_1 = __importDefault(require("./reportError")); | ||
const chalk = require("chalk"); | ||
function default_1(log$, config) { | ||
@@ -15,3 +15,3 @@ log$.subscribe({ | ||
if (log.name === 'pnpm:fetching-progress') { | ||
console.log(`${chalk.cyan(`fetching_${log.status}`)} ${log.packageId}`); | ||
console.log(`${chalk_1.default.cyan(`fetching_${log.status}`)} ${log.packageId}`); | ||
return; | ||
@@ -24,3 +24,3 @@ } | ||
case 'error': | ||
console.log(reportError_1.default(log, config)); | ||
console.log((0, reportError_1.default)(log, config)); | ||
return; | ||
@@ -40,4 +40,4 @@ case 'debug': | ||
// trims whitespace at the beginning | ||
return `${chalk.bgYellow.black('\u2009WARN\u2009')} ${message}`; | ||
return `${chalk_1.default.bgYellow.black('\u2009WARN\u2009')} ${message}`; | ||
} | ||
//# sourceMappingURL=reporterForServer.js.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const R = __importStar(require("ramda")); | ||
const stacktracey_1 = __importDefault(require("stacktracey")); | ||
const constants_1 = require("./constants"); | ||
const chalk = require("chalk"); | ||
const R = require("ramda"); | ||
const StackTracey = require("stacktracey"); | ||
StackTracey.maxColumnWidths = { | ||
stacktracey_1.default.maxColumnWidths = { | ||
callee: 25, | ||
@@ -12,4 +34,4 @@ file: 350, | ||
}; | ||
const highlight = chalk.yellow; | ||
const colorPath = chalk.gray; | ||
const highlight = chalk_1.default.yellow; | ||
const colorPath = chalk_1.default.gray; | ||
function reportError(logObj, config) { | ||
@@ -21,28 +43,28 @@ var _a, _b, _c, _d; | ||
case 'ERR_PNPM_UNEXPECTED_STORE': | ||
return reportUnexpectedStore(err, logObj['message']); | ||
return reportUnexpectedStore(err, logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_UNEXPECTED_VIRTUAL_STORE': | ||
return reportUnexpectedVirtualStoreDir(err, logObj['message']); | ||
return reportUnexpectedVirtualStoreDir(err, logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_STORE_BREAKING_CHANGE': | ||
return reportStoreBreakingChange(logObj['message']); | ||
return reportStoreBreakingChange(logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_MODULES_BREAKING_CHANGE': | ||
return reportModulesBreakingChange(logObj['message']); | ||
return reportModulesBreakingChange(logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_MODIFIED_DEPENDENCY': | ||
return reportModifiedDependency(logObj['message']); | ||
return reportModifiedDependency(logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_LOCKFILE_BREAKING_CHANGE': | ||
return reportLockfileBreakingChange(err, logObj['message']); | ||
return reportLockfileBreakingChange(err, logObj); | ||
case 'ERR_PNPM_RECURSIVE_RUN_NO_SCRIPT': | ||
return formatErrorSummary(err.message); | ||
case 'ERR_PNPM_NO_MATCHING_VERSION': | ||
return formatNoMatchingVersion(err, logObj['message']); | ||
return formatNoMatchingVersion(err, logObj); | ||
case 'ERR_PNPM_RECURSIVE_FAIL': | ||
return formatRecursiveCommandSummary(logObj['message']); | ||
return formatRecursiveCommandSummary(logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_BAD_TARBALL_SIZE': | ||
return reportBadTarballSize(err, logObj['message']); | ||
return reportBadTarballSize(err, logObj); | ||
case 'ELIFECYCLE': | ||
return reportLifecycleError(logObj['message']); | ||
return reportLifecycleError(logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_UNSUPPORTED_ENGINE': | ||
return reportEngineError(err, logObj['message']); | ||
return reportEngineError(err, logObj); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
case 'ERR_PNPM_FETCH_401': | ||
case 'ERR_PNPM_FETCH_403': | ||
return reportAuthError(err, logObj['message'], config); | ||
return reportAuthError(err, logObj, config); // eslint-disable-line @typescript-eslint/no-explicit-any | ||
default: { | ||
@@ -54,9 +76,7 @@ // Errors with unknown error codes are printed with stack trace | ||
let errorOutput = formatErrorSummary(err.message); | ||
if (!logObj['message']) | ||
return errorOutput; | ||
if ((_d = logObj['message']['pkgsStack']) === null || _d === void 0 ? void 0 : _d.length) { | ||
errorOutput += `${constants_1.EOL}${formatPkgsStack(logObj['message']['pkgsStack'])}`; | ||
if ((_d = logObj['pkgsStack']) === null || _d === void 0 ? void 0 : _d.length) { | ||
errorOutput += `${constants_1.EOL}${formatPkgsStack(logObj['pkgsStack'])}`; | ||
} | ||
if (logObj['message']['hint']) { | ||
errorOutput += `${constants_1.EOL}${logObj['message']['hint']}`; | ||
if (logObj['hint']) { | ||
errorOutput += `${constants_1.EOL}${logObj['hint']}`; | ||
} | ||
@@ -156,3 +176,3 @@ return errorOutput; | ||
try { | ||
prettyStack = new StackTracey(stack).pretty; | ||
prettyStack = new stacktracey_1.default(stack).pretty; | ||
} | ||
@@ -169,3 +189,3 @@ catch (err) { | ||
function formatErrorSummary(message) { | ||
return `${chalk.bgRed.black('\u2009ERROR\u2009')} ${chalk.red(message)}`; | ||
return `${chalk_1.default.bgRed.black('\u2009ERROR\u2009')} ${chalk_1.default.red(message)}`; | ||
} | ||
@@ -188,3 +208,3 @@ function reportModifiedDependency(msg) { | ||
function formatRecursiveCommandSummary(msg) { | ||
const output = constants_1.EOL + `Summary: ${chalk.red(`${msg.fails.length} fails`)}, ${msg.passes} passes` + constants_1.EOL + constants_1.EOL + | ||
const output = constants_1.EOL + `Summary: ${chalk_1.default.red(`${msg.fails.length} fails`)}, ${msg.passes} passes` + constants_1.EOL + constants_1.EOL + | ||
msg.fails.map((fail) => { | ||
@@ -191,0 +211,0 @@ return fail.prefix + ':' + constants_1.EOL + formatErrorSummary(fail.message); |
{ | ||
"name": "@pnpm/default-reporter", | ||
"version": "7.10.7", | ||
"version": "8.0.0", | ||
"description": "The default reporter of pnpm", | ||
@@ -18,3 +18,3 @@ "main": "lib/index.js", | ||
"prepublishOnly": "pnpm run compile", | ||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build" | ||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix" | ||
}, | ||
@@ -25,5 +25,4 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/default-reporter", | ||
], | ||
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)", | ||
"engines": { | ||
"node": ">=10.16" | ||
"node": ">=12.17" | ||
}, | ||
@@ -35,7 +34,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"@pnpm/config": "11.14.2", | ||
"@pnpm/core-loggers": "5.0.3", | ||
"@pnpm/error": "1.4.0", | ||
"@pnpm/types": "6.4.0", | ||
"@pnpm/config": "12.0.0", | ||
"@pnpm/core-loggers": "6.0.0", | ||
"@pnpm/error": "2.0.0", | ||
"@pnpm/types": "7.0.0", | ||
"ansi-diff": "^1.1.1", | ||
"boxen": "^5.0.0", | ||
"chalk": "^4.1.0", | ||
@@ -54,3 +54,3 @@ "normalize-path": "^3.0.0", | ||
"devDependencies": { | ||
"@pnpm/logger": "^3.2.3", | ||
"@pnpm/logger": "^4.0.0", | ||
"@types/normalize-path": "^3.0.0", | ||
@@ -57,0 +57,0 @@ "@types/ramda": "^0.27.35", |
Sorry, the diff of this file is not supported yet
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
105727
7.56%54
3.85%2197
4.97%17
6.25%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated