@pnpm/default-reporter
Advanced tools
Comparing version
# @pnpm/default-reporter | ||
## 8.0.2 | ||
### Patch Changes | ||
- Updated dependencies [05baaa6e7] | ||
- Updated dependencies [dfdf669e6] | ||
- Updated dependencies [97c64bae4] | ||
- @pnpm/config@12.2.0 | ||
- @pnpm/types@7.1.0 | ||
- @pnpm/core-loggers@6.0.1 | ||
## 8.0.1 | ||
@@ -4,0 +15,0 @@ |
@@ -40,3 +40,3 @@ "use strict"; | ||
const log$ = Rx.fromEvent(opts.streamParser, 'data'); | ||
(0, reporterForServer_1.default)(log$, opts.context.config); | ||
reporterForServer_1.default(log$, opts.context.config); | ||
return; | ||
@@ -55,3 +55,3 @@ } | ||
} | ||
const diff = (0, ansi_diff_1.default)({ | ||
const diff = ansi_diff_1.default({ | ||
height: process.stdout.rows, | ||
@@ -190,3 +190,3 @@ outputMaxWidth, | ||
}; | ||
const outputs = (0, reporterForClient_1.default)(log$, { | ||
const outputs = reporterForClient_1.default(log$, { | ||
appendOnly: (_a = opts.reportingOptions) === null || _a === void 0 ? void 0 : _a.appendOnly, | ||
@@ -204,7 +204,7 @@ cmd: opts.context.argv[0], | ||
return Rx.merge(...outputs) | ||
.pipe((0, operators_1.map)((log) => log.pipe((0, operators_1.map)((msg) => msg.msg))), (0, operators_1.mergeAll)()); | ||
.pipe(operators_1.map((log) => log.pipe(operators_1.map((msg) => msg.msg))), operators_1.mergeAll()); | ||
} | ||
return (0, mergeOutputs_1.default)(outputs); | ||
return mergeOutputs_1.default(outputs); | ||
} | ||
exports.toOutput$ = toOutput$; | ||
//# sourceMappingURL=index.js.map |
@@ -30,6 +30,6 @@ "use strict"; | ||
let previousOuput = null; | ||
return Rx.merge(...outputs).pipe((0, operators_1.map)((log) => { | ||
return Rx.merge(...outputs).pipe(operators_1.map((log) => { | ||
let currentBlockNo = -1; | ||
let currentFixedBlockNo = -1; | ||
return log.pipe((0, operators_1.map)((msg) => { | ||
return log.pipe(operators_1.map((msg) => { | ||
if (msg['fixed']) { | ||
@@ -55,3 +55,3 @@ if (currentFixedBlockNo === -1) { | ||
})); | ||
}), (0, operators_1.mergeAll)(), (0, operators_1.scan)((acc, log) => { | ||
}), operators_1.mergeAll(), operators_1.scan((acc, log) => { | ||
if (log.fixed) { | ||
@@ -65,3 +65,3 @@ acc.fixedBlocks[log.blockNo] = log.msg; | ||
return acc; | ||
}, { fixedBlocks: [], blocks: [] }), (0, operators_1.map)((sections) => { | ||
}, { fixedBlocks: [], blocks: [] }), operators_1.map((sections) => { | ||
const fixedBlocks = sections.fixedBlocks.filter(Boolean); | ||
@@ -77,3 +77,3 @@ const nonFixedPart = sections.blocks.filter(Boolean).join(constants_1.EOL); | ||
return `${nonFixedPart}${constants_1.EOL}${fixedPart}`; | ||
}), (0, operators_1.filter)((msg) => { | ||
}), operators_1.filter((msg) => { | ||
if (started) { | ||
@@ -86,3 +86,3 @@ return true; | ||
return true; | ||
}), (0, operators_1.filter)((msg) => { | ||
}), operators_1.filter((msg) => { | ||
if (msg !== previousOuput) { | ||
@@ -89,0 +89,0 @@ previousOuput = msg; |
@@ -26,10 +26,10 @@ "use strict"; | ||
const throttle = typeof opts.throttleProgress === 'number' && opts.throttleProgress > 0 | ||
? (0, operators_1.throttleTime)(opts.throttleProgress, undefined, { leading: true, trailing: true }) | ||
? operators_1.throttleTime(opts.throttleProgress, undefined, { leading: true, trailing: true }) | ||
: undefined; | ||
const outputs = [ | ||
(0, reportProgress_1.default)(log$, { | ||
reportProgress_1.default(log$, { | ||
cwd, | ||
throttle, | ||
}), | ||
(0, reportLifecycleScripts_1.default)(log$, { | ||
reportLifecycleScripts_1.default(log$, { | ||
appendOnly: opts.appendOnly === true || opts.streamLifecycleOutput, | ||
@@ -39,4 +39,4 @@ cwd, | ||
}), | ||
(0, reportDeprecations_1.default)(log$.deprecation, { cwd, isRecursive: opts.isRecursive }), | ||
(0, reportMisc_1.default)(log$, { | ||
reportDeprecations_1.default(log$.deprecation, { cwd, isRecursive: opts.isRecursive }), | ||
reportMisc_1.default(log$, { | ||
config: opts.config, | ||
@@ -47,3 +47,3 @@ cwd, | ||
}), | ||
...(0, reportStats_1.default)(log$, { | ||
...reportStats_1.default(log$, { | ||
cmd: opts.cmd, | ||
@@ -54,15 +54,15 @@ 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), | ||
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 }), | ||
reportUpdateCheck_1.default(log$.updateCheck), | ||
]; | ||
if (!opts.appendOnly) { | ||
outputs.push((0, reportBigTarballsProgress_1.default)(log$)); | ||
outputs.push(reportBigTarballsProgress_1.default(log$)); | ||
} | ||
if (!opts.isRecursive) { | ||
outputs.push((0, reportSummary_1.default)(log$, { | ||
outputs.push(reportSummary_1.default(log$, { | ||
cwd, | ||
@@ -69,0 +69,0 @@ pnpmConfig: opts.pnpmConfig, |
@@ -35,8 +35,8 @@ "use strict"; | ||
const deprecationSet$ = log$.deprecation | ||
.pipe((0, operators_1.filter)((log) => log.prefix === opts.prefix), (0, operators_1.scan)((acc, log) => { | ||
.pipe(operators_1.filter((log) => log.prefix === opts.prefix), operators_1.scan((acc, log) => { | ||
acc.add(log.pkgId); | ||
return acc; | ||
}, 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) => { | ||
}, 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) => { | ||
const rootLog = args[0]; | ||
@@ -71,3 +71,3 @@ const deprecationSet = args[1]; | ||
prod: {}, | ||
}), (0, operators_1.startWith)({ | ||
}), operators_1.startWith({ | ||
dev: {}, | ||
@@ -79,7 +79,7 @@ nodeModulesOnly: {}, | ||
})); | ||
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 | ||
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 | ||
); | ||
return Rx.combineLatest(pkgsDiff$, packageManifest$) | ||
.pipe((0, operators_1.map)(([pkgsDiff, packageManifests]) => { | ||
.pipe(operators_1.map(([pkgsDiff, packageManifests]) => { | ||
if ((packageManifests['initial'] == null) || (packageManifests['updated'] == null)) | ||
@@ -86,0 +86,0 @@ return pkgsDiff; |
@@ -11,14 +11,14 @@ "use strict"; | ||
exports.default = (log$) => { | ||
return log$.fetchingProgress.pipe((0, operators_1.filter)((log) => log.status === 'started' && | ||
return log$.fetchingProgress.pipe(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), (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) => { | ||
log.attempt === 1), operators_1.map((startedLog) => { | ||
const size = pretty_bytes_1.default(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) => { | ||
const done = startedLog['size'] === downloadedRaw; | ||
const downloaded = (0, pretty_bytes_1.default)(downloadedRaw); | ||
const downloaded = pretty_bytes_1.default(downloadedRaw); | ||
return { | ||
fixed: !done, | ||
msg: `Downloading ${(0, outputConstants_1.hlPkgId)(startedLog['packageId'])}: ${(0, outputConstants_1.hlValue)(downloaded)}/${(0, outputConstants_1.hlValue)(size)}${done ? ', done' : ''}`, | ||
msg: `Downloading ${outputConstants_1.hlPkgId(startedLog['packageId'])}: ${outputConstants_1.hlValue(downloaded)}/${outputConstants_1.hlValue(size)}${done ? ', done' : ''}`, | ||
}; | ||
@@ -25,0 +25,0 @@ })); |
@@ -30,4 +30,4 @@ "use strict"; | ||
exports.default = (log$, opts) => { | ||
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]) => { | ||
return Rx.combineLatest(log$.context.pipe(operators_1.take(1)), log$.packageImportMethod.pipe(operators_1.take(1))) | ||
.pipe(operators_1.map(([context, packageImportMethod]) => { | ||
if (context.currentLockfileExists) { | ||
@@ -55,3 +55,3 @@ return Rx.NEVER; | ||
Content-addressable store is at: ${context.storeDir} | ||
Virtual store is at: ${(0, normalize_path_1.default)(path_1.default.relative(opts.cwd, context.virtualStoreDir))}`, | ||
Virtual store is at: ${normalize_path_1.default(path_1.default.relative(opts.cwd, context.virtualStoreDir))}`, | ||
}); | ||
@@ -58,0 +58,0 @@ })); |
@@ -33,10 +33,10 @@ "use strict"; | ||
// print warnings only about deprecated packages from the root | ||
(0, operators_1.filter)((log) => log.depth === 0), (0, operators_1.map)((log) => { | ||
operators_1.filter((log) => log.depth === 0), operators_1.map((log) => { | ||
if (!opts.isRecursive && log.prefix === opts.cwd) { | ||
return Rx.of({ | ||
msg: (0, formatWarn_1.default)(`${chalk_1.default.red('deprecated')} ${log.pkgName}@${log.pkgVersion}: ${log.deprecated}`), | ||
msg: formatWarn_1.default(`${chalk_1.default.red('deprecated')} ${log.pkgName}@${log.pkgVersion}: ${log.deprecated}`), | ||
}); | ||
} | ||
return Rx.of({ | ||
msg: (0, zooming_1.zoomOut)(opts.cwd, log.prefix, (0, formatWarn_1.default)(`${chalk_1.default.red('deprecated')} ${log.pkgName}@${log.pkgVersion}`)), | ||
msg: zooming_1.zoomOut(opts.cwd, log.prefix, formatWarn_1.default(`${chalk_1.default.red('deprecated')} ${log.pkgName}@${log.pkgVersion}`)), | ||
}); | ||
@@ -43,0 +43,0 @@ })); |
@@ -30,4 +30,4 @@ "use strict"; | ||
exports.default = (hook$, opts) => { | ||
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}`, { | ||
return hook$.pipe(operators_1.map((log) => Rx.of({ | ||
msg: zooming_1.autozoom(opts.cwd, log.prefix, `${chalk_1.default.magentaBright(log.hook)}: ${log.message}`, { | ||
zoomOutCurrent: opts.isRecursive, | ||
@@ -34,0 +34,0 @@ }), |
@@ -30,3 +30,3 @@ "use strict"; | ||
exports.default = (installCheck$, opts) => { | ||
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 }))); | ||
return installCheck$.pipe(operators_1.map((log) => formatInstallCheck(opts.cwd, log)), operators_1.filter(Boolean), operators_1.map((msg) => Rx.of({ msg }))); | ||
}; | ||
@@ -38,5 +38,5 @@ function formatInstallCheck(currentPrefix, logObj, opts) { | ||
case 'EBADPLATFORM': | ||
return (0, zooming_1.autozoom)(currentPrefix, logObj['prefix'], (0, formatWarn_1.default)(`Unsupported system. Skipping dependency ${logObj.pkgId}`), { zoomOutCurrent }); | ||
return zooming_1.autozoom(currentPrefix, logObj['prefix'], formatWarn_1.default(`Unsupported system. Skipping dependency ${logObj.pkgId}`), { zoomOutCurrent }); | ||
case 'ENOTSUP': | ||
return (0, zooming_1.autozoom)(currentPrefix, logObj['prefix'], logObj.toString(), { zoomOutCurrent }); | ||
return zooming_1.autozoom(currentPrefix, logObj['prefix'], logObj.toString(), { zoomOutCurrent }); | ||
default: | ||
@@ -43,0 +43,0 @@ return undefined; |
@@ -45,3 +45,3 @@ "use strict"; | ||
const streamLifecycleOutput = createStreamLifecycleOutput(opts.cwd); | ||
return log$.lifecycle.pipe((0, operators_1.map)((log) => Rx.of({ | ||
return log$.lifecycle.pipe(operators_1.map((log) => Rx.of({ | ||
msg: streamLifecycleOutput(log), | ||
@@ -90,3 +90,3 @@ }))); | ||
var _a; | ||
messageCache.label = (_a = messageCache.label) !== null && _a !== void 0 ? _a : `${highlightLastFolder((0, formatPrefix_1.formatPrefixNoTrim)(opts.cwd, log.wd))}: Running ${log.stage} script`; | ||
messageCache.label = (_a = messageCache.label) !== null && _a !== void 0 ? _a : `${highlightLastFolder(formatPrefix_1.formatPrefixNoTrim(opts.cwd, log.wd))}: Running ${log.stage} script`; | ||
if (!opts.exit) { | ||
@@ -96,3 +96,3 @@ updateMessageCache(log, messageCache, opts); | ||
} | ||
const time = (0, pretty_ms_1.default)(toNano(process.hrtime(messageCache.startTime))); | ||
const time = pretty_ms_1.default(toNano(process.hrtime(messageCache.startTime))); | ||
if (log['exitCode'] === 0) { | ||
@@ -131,3 +131,3 @@ return `${messageCache.label}, done in ${time}`; | ||
if (log['script']) { | ||
const prefix = `${(0, formatPrefix_1.default)(opts.cwd, log.wd)} ${(0, outputConstants_1.hlValue)(log.stage)}`; | ||
const prefix = `${formatPrefix_1.default(opts.cwd, log.wd)} ${outputConstants_1.hlValue(log.stage)}`; | ||
const maxLineWidth = opts.maxWidth - prefix.length - 2 + ANSI_ESCAPES_LENGTH_OF_PREFIX; | ||
@@ -137,3 +137,3 @@ messageCache.script = `${prefix}$ ${cutLine(log['script'], maxLineWidth)}`; | ||
else if (opts.exit) { | ||
const time = (0, pretty_ms_1.default)(toNano(process.hrtime(messageCache.startTime))); | ||
const time = pretty_ms_1.default(toNano(process.hrtime(messageCache.startTime))); | ||
if (log['exitCode'] === 0) { | ||
@@ -157,3 +157,3 @@ messageCache.status = formatIndentedStatus(chalk_1.default.magentaBright(`Done in ${time}`)); | ||
} | ||
const ANSI_ESCAPES_LENGTH_OF_PREFIX = (0, outputConstants_1.hlValue)(' ').length - 1; | ||
const ANSI_ESCAPES_LENGTH_OF_PREFIX = outputConstants_1.hlValue(' ').length - 1; | ||
function createStreamLifecycleOutput(cwd) { | ||
@@ -190,3 +190,3 @@ currentColor = 0; | ||
const color = colorByPkg.get(wd); | ||
return `${color((0, formatPrefix_1.default)(cwd, wd))} ${(0, outputConstants_1.hlValue)(stage)}`; | ||
return `${color(formatPrefix_1.default(cwd, wd))} ${outputConstants_1.hlValue(stage)}`; | ||
} | ||
@@ -202,4 +202,4 @@ function formatLine(maxWidth, logObj) { | ||
function cutLine(line, maxLength) { | ||
return (0, strip_ansi_1.default)(line).substr(0, maxLength); | ||
return strip_ansi_1.default(line).substr(0, maxLength); | ||
} | ||
//# sourceMappingURL=reportLifecycleScripts.js.map |
@@ -44,4 +44,4 @@ "use strict"; | ||
const reportWarning = makeWarningReporter(opts); | ||
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) => { | ||
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) => { | ||
switch (obj.level) { | ||
@@ -54,6 +54,6 @@ case 'warn': { | ||
return Rx.of({ | ||
msg: `${obj['prefix']}:` + os_1.default.EOL + (0, reportError_1.default)(obj, opts.config), | ||
msg: `${obj['prefix']}:` + os_1.default.EOL + reportError_1.default(obj, opts.config), | ||
}); | ||
} | ||
return Rx.of({ msg: (0, reportError_1.default)(obj, opts.config) }); | ||
return Rx.of({ msg: reportError_1.default(obj, opts.config) }); | ||
default: | ||
@@ -74,5 +74,5 @@ return Rx.of({ msg: obj['message'] }); | ||
if (warningsCounter <= MAX_SHOWN_WARNINGS) { | ||
return Rx.of({ msg: (0, zooming_1.autozoom)(opts.cwd, obj.prefix, (0, formatWarn_1.default)(obj.message), opts) }); | ||
return Rx.of({ msg: zooming_1.autozoom(opts.cwd, obj.prefix, formatWarn_1.default(obj.message), opts) }); | ||
} | ||
const warningMsg = (0, formatWarn_1.default)(`${warningsCounter - MAX_SHOWN_WARNINGS} other warnings`); | ||
const warningMsg = formatWarn_1.default(`${warningsCounter - MAX_SHOWN_WARNINGS} other warnings`); | ||
if (!collapsedWarnings) { | ||
@@ -79,0 +79,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((0, operators_1.map)(({ importingDone$, progress$, requirer }) => { | ||
return getModulesInstallProgress$(log$.stage, log$.progress).pipe(operators_1.map(({ importingDone$, progress$, requirer }) => { | ||
const output$ = progressOutput(importingDone$, progress$); | ||
@@ -34,4 +34,4 @@ if (requirer === opts.cwd) { | ||
} | ||
return output$.pipe((0, operators_1.map)((msg) => { | ||
msg['msg'] = (0, zooming_1.zoomOut)(opts.cwd, requirer, msg['msg']); | ||
return output$.pipe(operators_1.map((msg) => { | ||
msg['msg'] = 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((0, operators_1.takeWhile)(([, importingDone]) => !importingDone, true)); | ||
.pipe(operators_1.takeWhile(([, importingDone]) => !importingDone, true)); | ||
if (throttle != null) { | ||
combinedProgress = combinedProgress.pipe(throttle); | ||
} | ||
return combinedProgress.pipe((0, operators_1.map)(createStatusMessage)); | ||
return combinedProgress.pipe(operators_1.map(createStatusMessage)); | ||
} | ||
@@ -82,3 +82,3 @@ function getModulesInstallProgress$(stage$, progress$) { | ||
return stage$ | ||
.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)); | ||
.pipe(operators_1.filter((log) => log.stage === 'importing_done'), operators_1.mapTo(true), operators_1.take(1), operators_1.startWith(false)); | ||
} | ||
@@ -121,3 +121,3 @@ function getProgessStatsPushStreamByRequirer(progress$) { | ||
function createStatusMessage([progress, importingDone]) { | ||
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())}`; | ||
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())}`; | ||
if (importingDone) { | ||
@@ -124,0 +124,0 @@ return { |
@@ -30,3 +30,3 @@ "use strict"; | ||
exports.default = (requestRetry$) => { | ||
return requestRetry$.pipe((0, operators_1.map)((log) => { | ||
return requestRetry$.pipe(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 ${(0, pretty_ms_1.default)(log.timeout, { verbose: true })}. \ | ||
Will retry in ${pretty_ms_1.default(log.timeout, { verbose: true })}. \ | ||
${retriesLeft} retries left.`; | ||
return Rx.of({ msg: (0, formatWarn_1.default)(msg) }); | ||
return Rx.of({ msg: formatWarn_1.default(msg) }); | ||
})); | ||
}; | ||
//# sourceMappingURL=reportRequestRetry.js.map |
@@ -39,3 +39,3 @@ "use strict"; | ||
} | ||
return scope$.pipe((0, operators_1.take)(1), (0, operators_1.map)((log) => { | ||
return scope$.pipe(operators_1.take(1), 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((0, operators_1.filter)((log) => Boolean(log['prefix'] === opts.cwd && log.parents && log.parents.length === 0)), (0, operators_1.map)((log) => Rx.of({ | ||
return skippedOptionalDependency$.pipe(operators_1.filter((log) => Boolean(log['prefix'] === opts.cwd && log.parents && log.parents.length === 0)), operators_1.map((log) => Rx.of({ | ||
msg: `info: ${ | ||
@@ -28,0 +28,0 @@ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions |
@@ -36,3 +36,3 @@ "use strict"; | ||
? log$.stats | ||
: log$.stats.pipe((0, operators_1.filter)((log) => log.prefix !== opts.cwd)); | ||
: log$.stats.pipe(operators_1.filter((log) => log.prefix !== opts.cwd)); | ||
const outputs = [ | ||
@@ -55,3 +55,3 @@ statsForNotCurrentPackage(stats$, { | ||
function statsForCurrentPackage(stats$, opts) { | ||
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) => { | ||
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) => { | ||
if (typeof log['added'] === 'number') { | ||
@@ -64,3 +64,3 @@ acc['added'] = log['added']; | ||
return acc; | ||
}, {}), (0, operators_1.map)((stats) => { | ||
}, {}), operators_1.map((stats) => { | ||
if (!stats['removed'] && !stats['added']) { | ||
@@ -88,3 +88,3 @@ if (opts.cmd === 'link') { | ||
const cookedStats$ = (opts.cmd !== 'remove' | ||
? stats$.pipe((0, operators_1.map)((log) => { | ||
? stats$.pipe(operators_1.map((log) => { | ||
// As of pnpm v2.9.0, during `pnpm recursive link`, logging of removed stats happens twice | ||
@@ -113,3 +113,3 @@ // 1. during linking | ||
: stats$); | ||
return cookedStats$.pipe((0, operators_1.filter)((stats) => stats !== null && (stats['removed'] || stats['added'])), (0, operators_1.map)((stats) => { | ||
return cookedStats$.pipe(operators_1.filter((stats) => stats !== null && (stats['removed'] || stats['added'])), operators_1.map((stats) => { | ||
const parts = []; | ||
@@ -124,4 +124,4 @@ if (stats['added']) { | ||
} | ||
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)); | ||
let msg = zooming_1.zoomOut(opts.currentPrefix, stats['prefix'], parts.join(' ')); | ||
const rest = Math.max(0, opts.width - 1 - string_length_1.default(msg)); | ||
msg += ' ' + printPlusesAndMinuses(rest, roundStats(stats['added'] || 0), roundStats(stats['removed'] || 0)); | ||
@@ -132,3 +132,3 @@ return Rx.of({ msg }); | ||
function padStep(s, step) { | ||
const sLength = (0, string_length_1.default)(s); | ||
const sLength = string_length_1.default(s); | ||
const placeholderLength = Math.ceil(sLength / step) * step; | ||
@@ -135,0 +135,0 @@ if (sLength < placeholderLength) { |
@@ -35,6 +35,6 @@ "use strict"; | ||
exports.default = (log$, opts) => { | ||
const pkgsDiff$ = (0, pkgsDiff_1.default)(log$, { prefix: opts.cwd }); | ||
const summaryLog$ = log$.summary.pipe((0, operators_1.take)(1)); | ||
const pkgsDiff$ = pkgsDiff_1.default(log$, { prefix: opts.cwd }); | ||
const summaryLog$ = log$.summary.pipe(operators_1.take(1)); | ||
return Rx.combineLatest(pkgsDiff$, summaryLog$) | ||
.pipe((0, operators_1.take)(1), (0, operators_1.map)(([pkgsDiff]) => { | ||
.pipe(operators_1.take(1), operators_1.map(([pkgsDiff]) => { | ||
var _a; | ||
@@ -41,0 +41,0 @@ let msg = ''; |
@@ -31,4 +31,4 @@ "use strict"; | ||
exports.default = (log$) => { | ||
return log$.pipe((0, operators_1.take)(1), (0, operators_1.filter)((log) => semver_1.default.gt(log.latestVersion, log.currentVersion)), (0, operators_1.map)((log) => Rx.of({ | ||
msg: (0, boxen_1.default)(`\ | ||
return log$.pipe(operators_1.take(1), operators_1.filter((log) => semver_1.default.gt(log.latestVersion, log.currentVersion)), operators_1.map((log) => Rx.of({ | ||
msg: boxen_1.default(`\ | ||
Update available! ${chalk_1.default.red(log.currentVersion)} → ${chalk_1.default.green(log.latestVersion)}. | ||
@@ -35,0 +35,0 @@ ${chalk_1.default.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${log.latestVersion} |
@@ -24,5 +24,5 @@ "use strict"; | ||
function formatPrefixNoTrim(cwd, prefix) { | ||
return (0, normalize_path_1.default)(path_1.default.relative(cwd, prefix) || '.'); | ||
return normalize_path_1.default(path_1.default.relative(cwd, prefix) || '.'); | ||
} | ||
exports.formatPrefixNoTrim = formatPrefixNoTrim; | ||
//# sourceMappingURL=formatPrefix.js.map |
@@ -18,5 +18,5 @@ "use strict"; | ||
function zoomOut(currentPrefix, logPrefix, line) { | ||
return `${(0, right_pad_1.default)((0, formatPrefix_1.default)(currentPrefix, logPrefix), outputConstants_1.PREFIX_MAX_LENGTH)} | ${line}`; | ||
return `${right_pad_1.default(formatPrefix_1.default(currentPrefix, logPrefix), outputConstants_1.PREFIX_MAX_LENGTH)} | ${line}`; | ||
} | ||
exports.zoomOut = zoomOut; | ||
//# sourceMappingURL=zooming.js.map |
@@ -22,3 +22,3 @@ "use strict"; | ||
case 'error': | ||
console.log((0, reportError_1.default)(log, config)); | ||
console.log(reportError_1.default(log, config)); | ||
return; | ||
@@ -25,0 +25,0 @@ case 'debug': |
{ | ||
"name": "@pnpm/default-reporter", | ||
"version": "8.0.1", | ||
"version": "8.0.2", | ||
"description": "The default reporter of pnpm", | ||
@@ -23,6 +23,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@pnpm/config": "12.1.0", | ||
"@pnpm/core-loggers": "6.0.0", | ||
"@pnpm/config": "12.2.0", | ||
"@pnpm/core-loggers": "6.0.1", | ||
"@pnpm/error": "2.0.0", | ||
"@pnpm/types": "7.0.0", | ||
"@pnpm/types": "7.1.0", | ||
"ansi-diff": "^1.1.1", | ||
@@ -45,3 +45,3 @@ "boxen": "^5.0.0", | ||
"@types/normalize-path": "^3.0.0", | ||
"@types/ramda": "^0.27.35", | ||
"@types/ramda": "0.27.39", | ||
"@types/semver": "^7.3.4", | ||
@@ -48,0 +48,0 @@ "ghooks": "2.0.4", |
105350
-35.8%54
-31.65%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated
Updated