@pnpm/cli.default-reporter 1100.3.7 → 1100.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/lib/index.js +20 -1
- package/package.json +4 -4
- package/lib/cli.d.ts +0 -1
- package/lib/cli.js +0 -50
- package/lib/constants.d.ts +0 -1
- package/lib/constants.js +0 -4
- package/lib/index.d.ts +0 -54
- package/lib/mergeOutputs.d.ts +0 -4
- package/lib/mergeOutputs.js +0 -69
- package/lib/reportError.d.ts +0 -3
- package/lib/reportError.js +0 -426
- package/lib/reporterForClient/index.d.ts +0 -53
- package/lib/reporterForClient/index.js +0 -98
- package/lib/reporterForClient/outputConstants.d.ts +0 -4
- package/lib/reporterForClient/outputConstants.js +0 -6
- package/lib/reporterForClient/pkgsDiff.d.ts +0 -36
- package/lib/reporterForClient/pkgsDiff.js +0 -113
- package/lib/reporterForClient/reportBigTarballsProgress.d.ts +0 -8
- package/lib/reporterForClient/reportBigTarballsProgress.js +0 -26
- package/lib/reporterForClient/reportContext.d.ts +0 -10
- package/lib/reporterForClient/reportContext.js +0 -34
- package/lib/reporterForClient/reportDeprecations.d.ts +0 -11
- package/lib/reporterForClient/reportDeprecations.js +0 -27
- package/lib/reporterForClient/reportExecutionTime.d.ts +0 -6
- package/lib/reporterForClient/reportExecutionTime.js +0 -13
- package/lib/reporterForClient/reportHooks.d.ts +0 -8
- package/lib/reporterForClient/reportHooks.js +0 -12
- package/lib/reporterForClient/reportIgnoredBuilds.d.ts +0 -11
- package/lib/reporterForClient/reportIgnoredBuilds.js +0 -21
- package/lib/reporterForClient/reportInstallChecks.d.ts +0 -7
- package/lib/reporterForClient/reportInstallChecks.js +0 -19
- package/lib/reporterForClient/reportInstallingConfigDeps.d.ts +0 -5
- package/lib/reporterForClient/reportInstallingConfigDeps.js +0 -18
- package/lib/reporterForClient/reportLifecycleScripts.d.ts +0 -13
- package/lib/reporterForClient/reportLifecycleScripts.js +0 -197
- package/lib/reporterForClient/reportLockfileVerification.d.ts +0 -15
- package/lib/reporterForClient/reportLockfileVerification.js +0 -73
- package/lib/reporterForClient/reportMisc.d.ts +0 -17
- package/lib/reporterForClient/reportMisc.js +0 -69
- package/lib/reporterForClient/reportPeerDependencyIssues.d.ts +0 -7
- package/lib/reporterForClient/reportPeerDependencyIssues.js +0 -11
- package/lib/reporterForClient/reportProgress.d.ts +0 -16
- package/lib/reporterForClient/reportProgress.js +0 -123
- package/lib/reporterForClient/reportRequestRetry.d.ts +0 -5
- package/lib/reporterForClient/reportRequestRetry.js +0 -18
- package/lib/reporterForClient/reportScope.d.ts +0 -8
- package/lib/reporterForClient/reportScope.js +0 -41
- package/lib/reporterForClient/reportSkippedOptionalDependencies.d.ts +0 -7
- package/lib/reporterForClient/reportSkippedOptionalDependencies.js +0 -8
- package/lib/reporterForClient/reportStats.d.ts +0 -13
- package/lib/reporterForClient/reportStats.js +0 -143
- package/lib/reporterForClient/reportSummary.d.ts +0 -19
- package/lib/reporterForClient/reportSummary.js +0 -79
- package/lib/reporterForClient/reportUpdateCheck.d.ts +0 -8
- package/lib/reporterForClient/reportUpdateCheck.js +0 -42
- package/lib/reporterForClient/utils/formatPrefix.d.ts +0 -2
- package/lib/reporterForClient/utils/formatPrefix.js +0 -19
- package/lib/reporterForClient/utils/formatWarn.d.ts +0 -1
- package/lib/reporterForClient/utils/formatWarn.js +0 -5
- package/lib/reporterForClient/utils/zooming.d.ts +0 -4
- package/lib/reporterForClient/utils/zooming.js +0 -13
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import * as Rx from 'rxjs';
|
|
4
|
-
import { map, take } from 'rxjs/operators';
|
|
5
|
-
import semver from 'semver';
|
|
6
|
-
import { EOL } from '../constants.js';
|
|
7
|
-
import { ADDED_CHAR, REMOVED_CHAR, } from './outputConstants.js';
|
|
8
|
-
import { getPkgsDiff, propertyByDependencyType, } from './pkgsDiff.js';
|
|
9
|
-
const CONFIG_BY_DEP_TYPE = {
|
|
10
|
-
prod: 'production',
|
|
11
|
-
dev: 'dev',
|
|
12
|
-
optional: 'optional',
|
|
13
|
-
};
|
|
14
|
-
export function reportSummary(log$, opts) {
|
|
15
|
-
const pkgsDiff$ = getPkgsDiff(log$, { prefix: opts.pnpmConfig?.global ? undefined : opts.cwd });
|
|
16
|
-
const summaryLog$ = log$.summary.pipe(take(1));
|
|
17
|
-
const _printDiffs = printDiffs.bind(null, { cmd: opts.cmd, prefix: opts.cwd, pnpmConfig: opts.pnpmConfig });
|
|
18
|
-
return Rx.combineLatest(pkgsDiff$, summaryLog$)
|
|
19
|
-
.pipe(take(1), map(([pkgsDiff]) => {
|
|
20
|
-
let msg = '';
|
|
21
|
-
for (const depType of ['prod', 'optional', 'peer', 'dev', 'nodeModulesOnly']) {
|
|
22
|
-
let diffs = Object.values(pkgsDiff[depType]);
|
|
23
|
-
if (opts.filterPkgsDiff) {
|
|
24
|
-
// This filtering is only used by Bit CLI currently.
|
|
25
|
-
// Related PR: https://github.com/teambit/bit/pull/7176
|
|
26
|
-
diffs = diffs.filter((pkgDiff) => opts.filterPkgsDiff(pkgDiff));
|
|
27
|
-
}
|
|
28
|
-
if (diffs.length > 0) {
|
|
29
|
-
msg += EOL;
|
|
30
|
-
msg += chalk.cyanBright(opts.pnpmConfig?.global ? 'global:' : `${propertyByDependencyType[depType]}:`);
|
|
31
|
-
msg += EOL;
|
|
32
|
-
msg += _printDiffs(diffs, depType);
|
|
33
|
-
msg += EOL;
|
|
34
|
-
}
|
|
35
|
-
else if (CONFIG_BY_DEP_TYPE[depType] && opts.pnpmConfig?.[CONFIG_BY_DEP_TYPE[depType]] === false) {
|
|
36
|
-
msg += EOL;
|
|
37
|
-
msg += `${chalk.cyanBright(`${propertyByDependencyType[depType]}:`)} skipped`;
|
|
38
|
-
msg += EOL;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return Rx.of({ msg });
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
function printDiffs(opts, pkgsDiff, depType) {
|
|
45
|
-
// Sorts by alphabet then by removed/added
|
|
46
|
-
// + ava 0.10.0
|
|
47
|
-
// - chalk 1.0.0
|
|
48
|
-
// + chalk 2.0.0
|
|
49
|
-
pkgsDiff.sort((a, b) => (a.name.localeCompare(b.name) * 10 + (Number(!b.added) - Number(!a.added))));
|
|
50
|
-
const msg = pkgsDiff.map((pkg) => {
|
|
51
|
-
let result = pkg.added
|
|
52
|
-
? ADDED_CHAR
|
|
53
|
-
: REMOVED_CHAR;
|
|
54
|
-
if (!pkg.realName || pkg.name === pkg.realName) {
|
|
55
|
-
result += ` ${pkg.name}`;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
result += ` ${pkg.name} <- ${pkg.realName}`;
|
|
59
|
-
}
|
|
60
|
-
if (pkg.version) {
|
|
61
|
-
result += ` ${chalk.grey(pkg.version)}`;
|
|
62
|
-
if (pkg.latest && semver.lt(pkg.version, pkg.latest)) {
|
|
63
|
-
result += ` ${chalk.grey(`(${pkg.latest} is available)`)}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (pkg.deprecated) {
|
|
67
|
-
result += ` ${chalk.red('deprecated')}`;
|
|
68
|
-
}
|
|
69
|
-
if (pkg.from) {
|
|
70
|
-
result += ` ${chalk.grey(`<- ${path.relative(opts.prefix, pkg.from) || pkg.from}`)}`;
|
|
71
|
-
}
|
|
72
|
-
if (pkg.added && depType === 'dev' && opts.pnpmConfig?.saveDev === false && opts.cmd === 'add') {
|
|
73
|
-
result += `${chalk.yellow(' already in devDependencies, was not moved to dependencies.')}`;
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
76
|
-
}).join(EOL);
|
|
77
|
-
return msg;
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=reportSummary.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { UpdateCheckLog } from '@pnpm/core-loggers';
|
|
2
|
-
import * as Rx from 'rxjs';
|
|
3
|
-
export declare function reportUpdateCheck(log$: Rx.Observable<UpdateCheckLog>, opts: {
|
|
4
|
-
env: NodeJS.ProcessEnv;
|
|
5
|
-
process: NodeJS.Process;
|
|
6
|
-
}): Rx.Observable<Rx.Observable<{
|
|
7
|
-
msg: string;
|
|
8
|
-
}>>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { detectIfCurrentPkgIsExecutable, isExecutedByCorepack } from '@pnpm/cli.meta';
|
|
2
|
-
import boxen from 'boxen';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import * as Rx from 'rxjs';
|
|
5
|
-
import { filter, map, take } from 'rxjs/operators';
|
|
6
|
-
import semver from 'semver';
|
|
7
|
-
export function reportUpdateCheck(log$, opts) {
|
|
8
|
-
return log$.pipe(take(1), filter((log) => semver.gt(log.latestVersion, log.currentVersion)), map((log) => {
|
|
9
|
-
const updateMessage = renderUpdateMessage({
|
|
10
|
-
currentPkgIsExecutable: detectIfCurrentPkgIsExecutable(opts.process),
|
|
11
|
-
latestVersion: log.latestVersion,
|
|
12
|
-
env: opts.env,
|
|
13
|
-
});
|
|
14
|
-
return Rx.of({
|
|
15
|
-
msg: boxen(`\
|
|
16
|
-
Update available! ${chalk.red(log.currentVersion)} → ${chalk.green(log.latestVersion)}.
|
|
17
|
-
${chalk.magenta('Changelog:')} https://pnpm.io/v/${log.latestVersion}
|
|
18
|
-
${updateMessage}`, {
|
|
19
|
-
padding: 1,
|
|
20
|
-
margin: 1,
|
|
21
|
-
align: 'center',
|
|
22
|
-
borderColor: 'yellow',
|
|
23
|
-
borderStyle: 'round',
|
|
24
|
-
}),
|
|
25
|
-
});
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
28
|
-
function renderUpdateMessage(opts) {
|
|
29
|
-
const updateCommand = renderUpdateCommand(opts);
|
|
30
|
-
return `To update, run: ${chalk.magenta(updateCommand)}`;
|
|
31
|
-
}
|
|
32
|
-
function renderUpdateCommand(opts) {
|
|
33
|
-
if (isExecutedByCorepack(opts.env)) {
|
|
34
|
-
return `corepack use pnpm@${opts.latestVersion}`;
|
|
35
|
-
}
|
|
36
|
-
if (opts.env.PNPM_HOME) {
|
|
37
|
-
return 'pnpm self-update';
|
|
38
|
-
}
|
|
39
|
-
const pkgName = opts.currentPkgIsExecutable ? '@pnpm/exe' : 'pnpm';
|
|
40
|
-
return `pnpm add -g ${pkgName}`;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=reportUpdateCheck.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import normalize from 'normalize-path';
|
|
3
|
-
import { PREFIX_MAX_LENGTH } from '../outputConstants.js';
|
|
4
|
-
export function formatPrefix(cwd, prefix) {
|
|
5
|
-
prefix = formatPrefixNoTrim(cwd, prefix);
|
|
6
|
-
if (prefix.length <= PREFIX_MAX_LENGTH) {
|
|
7
|
-
return prefix;
|
|
8
|
-
}
|
|
9
|
-
const shortPrefix = prefix.slice(-PREFIX_MAX_LENGTH + 3);
|
|
10
|
-
const separatorLocation = shortPrefix.indexOf('/');
|
|
11
|
-
if (separatorLocation <= 0) {
|
|
12
|
-
return `...${shortPrefix}`;
|
|
13
|
-
}
|
|
14
|
-
return `...${shortPrefix.slice(separatorLocation)}`;
|
|
15
|
-
}
|
|
16
|
-
export function formatPrefixNoTrim(cwd, prefix) {
|
|
17
|
-
return normalize(path.relative(cwd, prefix) || '.');
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=formatPrefix.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function formatWarn(message: string): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PREFIX_MAX_LENGTH } from '../outputConstants.js';
|
|
2
|
-
import { formatPrefix } from './formatPrefix.js';
|
|
3
|
-
export function autozoom(currentPrefix, logPrefix, line, opts) {
|
|
4
|
-
if (!logPrefix || !opts.zoomOutCurrent && currentPrefix === logPrefix) {
|
|
5
|
-
return line;
|
|
6
|
-
}
|
|
7
|
-
return zoomOut(currentPrefix, logPrefix, line);
|
|
8
|
-
}
|
|
9
|
-
export function zoomOut(currentPrefix, logPrefix, line) {
|
|
10
|
-
const prefix = formatPrefix(currentPrefix, logPrefix);
|
|
11
|
-
return `${prefix.padEnd(PREFIX_MAX_LENGTH)} | ${line}`;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=zooming.js.map
|