@pnpm/cli.default-reporter 1100.3.11 → 1100.3.13

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/cli.d.ts +1 -0
  3. package/lib/cli.js +50 -0
  4. package/lib/constants.d.ts +1 -0
  5. package/lib/constants.js +4 -0
  6. package/lib/index.d.ts +54 -0
  7. package/lib/mergeOutputs.d.ts +4 -0
  8. package/lib/mergeOutputs.js +69 -0
  9. package/lib/reportError.d.ts +3 -0
  10. package/lib/reportError.js +426 -0
  11. package/lib/reporterForClient/index.d.ts +53 -0
  12. package/lib/reporterForClient/index.js +98 -0
  13. package/lib/reporterForClient/outputConstants.d.ts +4 -0
  14. package/lib/reporterForClient/outputConstants.js +6 -0
  15. package/lib/reporterForClient/pkgsDiff.d.ts +36 -0
  16. package/lib/reporterForClient/pkgsDiff.js +113 -0
  17. package/lib/reporterForClient/reportBigTarballsProgress.d.ts +8 -0
  18. package/lib/reporterForClient/reportBigTarballsProgress.js +26 -0
  19. package/lib/reporterForClient/reportContext.d.ts +10 -0
  20. package/lib/reporterForClient/reportContext.js +34 -0
  21. package/lib/reporterForClient/reportDeprecations.d.ts +11 -0
  22. package/lib/reporterForClient/reportDeprecations.js +27 -0
  23. package/lib/reporterForClient/reportExecutionTime.d.ts +6 -0
  24. package/lib/reporterForClient/reportExecutionTime.js +13 -0
  25. package/lib/reporterForClient/reportHooks.d.ts +8 -0
  26. package/lib/reporterForClient/reportHooks.js +12 -0
  27. package/lib/reporterForClient/reportIgnoredBuilds.d.ts +11 -0
  28. package/lib/reporterForClient/reportIgnoredBuilds.js +21 -0
  29. package/lib/reporterForClient/reportInstallChecks.d.ts +7 -0
  30. package/lib/reporterForClient/reportInstallChecks.js +19 -0
  31. package/lib/reporterForClient/reportInstallingConfigDeps.d.ts +5 -0
  32. package/lib/reporterForClient/reportInstallingConfigDeps.js +18 -0
  33. package/lib/reporterForClient/reportLifecycleScripts.d.ts +13 -0
  34. package/lib/reporterForClient/reportLifecycleScripts.js +197 -0
  35. package/lib/reporterForClient/reportLockfileVerification.d.ts +15 -0
  36. package/lib/reporterForClient/reportLockfileVerification.js +73 -0
  37. package/lib/reporterForClient/reportMisc.d.ts +17 -0
  38. package/lib/reporterForClient/reportMisc.js +69 -0
  39. package/lib/reporterForClient/reportPeerDependencyIssues.d.ts +7 -0
  40. package/lib/reporterForClient/reportPeerDependencyIssues.js +11 -0
  41. package/lib/reporterForClient/reportProgress.d.ts +16 -0
  42. package/lib/reporterForClient/reportProgress.js +123 -0
  43. package/lib/reporterForClient/reportRequestRetry.d.ts +5 -0
  44. package/lib/reporterForClient/reportRequestRetry.js +18 -0
  45. package/lib/reporterForClient/reportScope.d.ts +8 -0
  46. package/lib/reporterForClient/reportScope.js +41 -0
  47. package/lib/reporterForClient/reportSkippedOptionalDependencies.d.ts +7 -0
  48. package/lib/reporterForClient/reportSkippedOptionalDependencies.js +8 -0
  49. package/lib/reporterForClient/reportStats.d.ts +13 -0
  50. package/lib/reporterForClient/reportStats.js +143 -0
  51. package/lib/reporterForClient/reportSummary.d.ts +19 -0
  52. package/lib/reporterForClient/reportSummary.js +79 -0
  53. package/lib/reporterForClient/reportUpdateCheck.d.ts +8 -0
  54. package/lib/reporterForClient/reportUpdateCheck.js +42 -0
  55. package/lib/reporterForClient/utils/formatPrefix.d.ts +2 -0
  56. package/lib/reporterForClient/utils/formatPrefix.js +19 -0
  57. package/lib/reporterForClient/utils/formatWarn.d.ts +1 -0
  58. package/lib/reporterForClient/utils/formatWarn.js +5 -0
  59. package/lib/reporterForClient/utils/zooming.d.ts +4 -0
  60. package/lib/reporterForClient/utils/zooming.js +13 -0
  61. package/package.json +15 -15
@@ -0,0 +1,53 @@
1
+ import type { Config, ConfigContext } from '@pnpm/config.reader';
2
+ import type * as logs from '@pnpm/core-loggers';
3
+ import type { LogLevel } from '@pnpm/logger';
4
+ import type * as Rx from 'rxjs';
5
+ import { type FilterPkgsDiff } from './reportSummary.js';
6
+ export declare function reporterForClient(log$: {
7
+ context: Rx.Observable<logs.ContextLog>;
8
+ fetchingProgress: Rx.Observable<logs.FetchingProgressLog>;
9
+ executionTime: Rx.Observable<logs.ExecutionTimeLog>;
10
+ ignoredScripts: Rx.Observable<logs.IgnoredScriptsLog>;
11
+ progress: Rx.Observable<logs.ProgressLog>;
12
+ stage: Rx.Observable<logs.StageLog>;
13
+ deprecation: Rx.Observable<logs.DeprecationLog>;
14
+ summary: Rx.Observable<logs.SummaryLog>;
15
+ lifecycle: Rx.Observable<logs.LifecycleLog>;
16
+ lockfileVerification: Rx.Observable<logs.LockfileVerificationLog>;
17
+ stats: Rx.Observable<logs.StatsLog>;
18
+ installCheck: Rx.Observable<logs.InstallCheckLog>;
19
+ installingConfigDeps: Rx.Observable<logs.InstallingConfigDepsLog>;
20
+ registry: Rx.Observable<logs.RegistryLog>;
21
+ root: Rx.Observable<logs.RootLog>;
22
+ packageManifest: Rx.Observable<logs.PackageManifestLog>;
23
+ peerDependencyIssues: Rx.Observable<logs.PeerDependencyIssuesLog>;
24
+ requestRetry: Rx.Observable<logs.RequestRetryLog>;
25
+ link: Rx.Observable<logs.LinkLog>;
26
+ other: Rx.Observable<logs.Log>;
27
+ hook: Rx.Observable<logs.HookLog>;
28
+ scope: Rx.Observable<logs.ScopeLog>;
29
+ skippedOptionalDependency: Rx.Observable<logs.SkippedOptionalDependencyLog>;
30
+ packageImportMethod: Rx.Observable<logs.PackageImportMethodLog>;
31
+ updateCheck: Rx.Observable<logs.UpdateCheckLog>;
32
+ }, opts: {
33
+ appendOnly?: boolean;
34
+ cmd: string;
35
+ config?: Config;
36
+ env: NodeJS.ProcessEnv;
37
+ filterPkgsDiff?: FilterPkgsDiff;
38
+ process: NodeJS.Process;
39
+ isRecursive: boolean;
40
+ logLevel?: LogLevel;
41
+ pnpmConfig?: Config & ConfigContext;
42
+ streamLifecycleOutput?: boolean;
43
+ aggregateOutput?: boolean;
44
+ throttleProgress?: number;
45
+ width?: number;
46
+ hideAddedPkgsProgress?: boolean;
47
+ hideProgressPrefix?: boolean;
48
+ hideLifecycleOutput?: boolean;
49
+ hideLifecyclePrefix?: boolean;
50
+ approveBuildsInstructionText?: string;
51
+ }): Array<Rx.Observable<Rx.Observable<{
52
+ msg: string;
53
+ }>>>;
@@ -0,0 +1,98 @@
1
+ import { throttleTime } from 'rxjs/operators';
2
+ import { reportBigTarballProgress } from './reportBigTarballsProgress.js';
3
+ import { reportContext } from './reportContext.js';
4
+ import { reportDeprecations } from './reportDeprecations.js';
5
+ import { reportExecutionTime } from './reportExecutionTime.js';
6
+ import { reportHooks } from './reportHooks.js';
7
+ import { reportIgnoredBuilds } from './reportIgnoredBuilds.js';
8
+ import { reportInstallChecks } from './reportInstallChecks.js';
9
+ import { reportInstallingConfigDeps } from './reportInstallingConfigDeps.js';
10
+ import { reportLifecycleScripts } from './reportLifecycleScripts.js';
11
+ import { reportLockfileVerification } from './reportLockfileVerification.js';
12
+ import { LOG_LEVEL_NUMBER, reportMisc } from './reportMisc.js';
13
+ import { reportPeerDependencyIssues } from './reportPeerDependencyIssues.js';
14
+ import { reportProgress } from './reportProgress.js';
15
+ import { reportRequestRetry } from './reportRequestRetry.js';
16
+ import { reportScope } from './reportScope.js';
17
+ import { reportSkippedOptionalDependencies } from './reportSkippedOptionalDependencies.js';
18
+ import { reportStats } from './reportStats.js';
19
+ import { reportSummary } from './reportSummary.js';
20
+ import { reportUpdateCheck } from './reportUpdateCheck.js';
21
+ const PRINT_EXECUTION_TIME_IN_COMMANDS = {
22
+ install: true,
23
+ update: true,
24
+ add: true,
25
+ remove: true,
26
+ };
27
+ export function reporterForClient(log$, opts) {
28
+ const width = opts.width ?? process.stdout.columns ?? 80;
29
+ const cwd = opts.pnpmConfig?.dir ?? process.cwd();
30
+ const throttle = typeof opts.throttleProgress === 'number' && opts.throttleProgress > 0
31
+ ? throttleTime(opts.throttleProgress, undefined, { leading: true, trailing: true })
32
+ : undefined;
33
+ const outputs = [
34
+ reportMisc(log$, {
35
+ appendOnly: opts.appendOnly === true,
36
+ config: opts.config,
37
+ cwd,
38
+ logLevel: opts.logLevel,
39
+ zoomOutCurrent: opts.isRecursive,
40
+ }),
41
+ ];
42
+ // logLevelNumber: 0123 = error warn info debug
43
+ const logLevelNumber = LOG_LEVEL_NUMBER[opts.logLevel ?? 'info'] ?? LOG_LEVEL_NUMBER['info'];
44
+ const showInfo = logLevelNumber >= LOG_LEVEL_NUMBER.info;
45
+ if (logLevelNumber >= LOG_LEVEL_NUMBER.warn) {
46
+ outputs.push(reportPeerDependencyIssues(log$), reportDeprecations({
47
+ deprecation: log$.deprecation,
48
+ stage: log$.stage,
49
+ }, { cwd, isRecursive: opts.isRecursive }), reportRequestRetry(log$.requestRetry));
50
+ }
51
+ if (showInfo) {
52
+ if (opts.cmd in PRINT_EXECUTION_TIME_IN_COMMANDS) {
53
+ outputs.push(reportExecutionTime(log$.executionTime));
54
+ }
55
+ if (opts.cmd !== 'dlx') {
56
+ outputs.push(reportContext(log$, { cwd }));
57
+ }
58
+ outputs.push(reportLifecycleScripts(log$, {
59
+ appendOnly: (opts.appendOnly === true || opts.streamLifecycleOutput) && !opts.hideLifecycleOutput,
60
+ aggregateOutput: opts.aggregateOutput,
61
+ hideLifecyclePrefix: opts.hideLifecyclePrefix,
62
+ cwd,
63
+ width,
64
+ }), reportInstallChecks(log$.installCheck, { cwd }), reportInstallingConfigDeps(log$.installingConfigDeps), reportLockfileVerification(log$.lockfileVerification, {
65
+ cwd,
66
+ workspaceDir: opts.pnpmConfig?.workspaceDir,
67
+ }), reportScope(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }), reportSkippedOptionalDependencies(log$.skippedOptionalDependency, { cwd }), reportHooks(log$.hook, { cwd, isRecursive: opts.isRecursive }), reportUpdateCheck(log$.updateCheck, opts), reportProgress(log$, {
68
+ cwd,
69
+ throttle,
70
+ hideAddedPkgsProgress: opts.hideAddedPkgsProgress,
71
+ hideProgressPrefix: opts.hideProgressPrefix,
72
+ }), ...reportStats(log$, {
73
+ cmd: opts.cmd,
74
+ cwd,
75
+ isRecursive: opts.isRecursive,
76
+ width,
77
+ hideProgressPrefix: opts.hideProgressPrefix,
78
+ }));
79
+ if (!opts.appendOnly) {
80
+ outputs.push(reportBigTarballProgress(log$));
81
+ }
82
+ if (!opts.isRecursive) {
83
+ outputs.push(reportSummary(log$, {
84
+ cmd: opts.cmd,
85
+ cwd,
86
+ env: opts.env,
87
+ filterPkgsDiff: opts.filterPkgsDiff,
88
+ pnpmConfig: opts.pnpmConfig,
89
+ }));
90
+ }
91
+ outputs.push(reportIgnoredBuilds(log$, {
92
+ pnpmConfig: opts.pnpmConfig,
93
+ approveBuildsInstructionText: opts.approveBuildsInstructionText,
94
+ }));
95
+ }
96
+ return outputs;
97
+ }
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ export declare const PREFIX_MAX_LENGTH = 40;
2
+ export declare const hlValue: import("chalk").ChalkInstance;
3
+ export declare const ADDED_CHAR: string;
4
+ export declare const REMOVED_CHAR: string;
@@ -0,0 +1,6 @@
1
+ import chalk from 'chalk';
2
+ export const PREFIX_MAX_LENGTH = 40;
3
+ export const hlValue = chalk.cyanBright;
4
+ export const ADDED_CHAR = chalk.green('+');
5
+ export const REMOVED_CHAR = chalk.red('-');
6
+ //# sourceMappingURL=outputConstants.js.map
@@ -0,0 +1,36 @@
1
+ import type * as logs from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export interface PackageDiff {
4
+ added: boolean;
5
+ from?: string;
6
+ name: string;
7
+ realName?: string;
8
+ version?: string;
9
+ deprecated?: boolean;
10
+ latest?: string;
11
+ }
12
+ export interface RecordByString<T> {
13
+ [index: string]: T;
14
+ }
15
+ export declare const propertyByDependencyType: {
16
+ readonly dev: 'devDependencies';
17
+ readonly nodeModulesOnly: 'node_modules';
18
+ readonly optional: 'optionalDependencies';
19
+ readonly peer: 'peerDependencies';
20
+ readonly prod: 'dependencies';
21
+ };
22
+ export interface PkgsDiff {
23
+ dev: RecordByString<PackageDiff>;
24
+ nodeModulesOnly: RecordByString<PackageDiff>;
25
+ optional: RecordByString<PackageDiff>;
26
+ peer: RecordByString<PackageDiff>;
27
+ prod: RecordByString<PackageDiff>;
28
+ }
29
+ export declare function getPkgsDiff(log$: {
30
+ deprecation: Rx.Observable<logs.DeprecationLog>;
31
+ summary: Rx.Observable<logs.SummaryLog>;
32
+ root: Rx.Observable<logs.RootLog>;
33
+ packageManifest: Rx.Observable<logs.PackageManifestLog>;
34
+ }, opts: {
35
+ prefix?: string;
36
+ }): Rx.Observable<PkgsDiff>;
@@ -0,0 +1,113 @@
1
+ import { difference, mergeRight } from 'ramda';
2
+ import * as Rx from 'rxjs';
3
+ import { filter, map, mapTo, reduce, scan, startWith, take } from 'rxjs/operators';
4
+ export const propertyByDependencyType = {
5
+ dev: 'devDependencies',
6
+ nodeModulesOnly: 'node_modules',
7
+ optional: 'optionalDependencies',
8
+ peer: 'peerDependencies',
9
+ prod: 'dependencies',
10
+ };
11
+ export function getPkgsDiff(log$, opts) {
12
+ const deprecationSet$ = log$.deprecation
13
+ .pipe(filter((log) => !opts.prefix || log.prefix === opts.prefix), scan((acc, log) => {
14
+ acc.add(log.pkgId);
15
+ return acc;
16
+ }, new Set()), startWith(new Set()));
17
+ const filterPrefix = opts.prefix
18
+ ? filter((log) => log.prefix === opts.prefix)
19
+ : (x) => x;
20
+ const pkgsDiff$ = Rx.combineLatest(log$.root.pipe(filterPrefix), deprecationSet$).pipe(scan((pkgsDiff, args) => {
21
+ const rootLog = args[0];
22
+ const deprecationSet = args[1];
23
+ let action;
24
+ let log; // eslint-disable-line
25
+ if ('added' in rootLog) {
26
+ action = '+';
27
+ log = rootLog['added'];
28
+ }
29
+ else if ('removed' in rootLog) {
30
+ action = '-';
31
+ log = rootLog['removed'];
32
+ }
33
+ else {
34
+ return pkgsDiff;
35
+ }
36
+ const depType = (log.dependencyType || 'nodeModulesOnly');
37
+ const oppositeKey = `${action === '-' ? '+' : '-'}${log.name}`;
38
+ const previous = pkgsDiff[depType][oppositeKey];
39
+ if (previous && previous.version === log.version) {
40
+ delete pkgsDiff[depType][oppositeKey];
41
+ return pkgsDiff;
42
+ }
43
+ pkgsDiff[depType][`${action}${log.name}`] = {
44
+ added: action === '+',
45
+ deprecated: deprecationSet.has(log.id),
46
+ from: log.linkedFrom,
47
+ latest: log.latest,
48
+ name: log.name,
49
+ realName: log.realName,
50
+ version: log.version ?? log.id,
51
+ };
52
+ return pkgsDiff;
53
+ }, {
54
+ dev: {},
55
+ nodeModulesOnly: {},
56
+ optional: {},
57
+ peer: {},
58
+ prod: {},
59
+ }), startWith({
60
+ dev: {},
61
+ nodeModulesOnly: {},
62
+ optional: {},
63
+ peer: {},
64
+ prod: {},
65
+ }));
66
+ const packageManifest$ = Rx.merge(log$.packageManifest.pipe(filterPrefix), log$.summary.pipe(filterPrefix, mapTo({})))
67
+ .pipe(take(2), reduce(mergeRight, {}) // eslint-disable-line @typescript-eslint/no-explicit-any
68
+ );
69
+ return Rx.combineLatest(pkgsDiff$, packageManifest$)
70
+ .pipe(map(([pkgsDiff, packageManifests]) => {
71
+ if ((packageManifests['initial'] == null) || (packageManifests['updated'] == null))
72
+ return pkgsDiff;
73
+ const initialPackageManifest = removeOptionalFromProdDeps(packageManifests['initial']);
74
+ const updatedPackageManifest = removeOptionalFromProdDeps(packageManifests['updated']);
75
+ for (const depType of ['peer', 'prod', 'optional', 'dev']) {
76
+ const prop = propertyByDependencyType[depType];
77
+ const initialDeps = Object.keys(initialPackageManifest[prop] ?? {});
78
+ const updatedDeps = Object.keys(updatedPackageManifest[prop] ?? {});
79
+ const removedDeps = difference(initialDeps, updatedDeps);
80
+ for (const removedDep of removedDeps) {
81
+ if (!pkgsDiff[depType][`-${removedDep}`]) {
82
+ pkgsDiff[depType][`-${removedDep}`] = {
83
+ added: false,
84
+ name: removedDep,
85
+ version: initialPackageManifest[prop]?.[removedDep],
86
+ };
87
+ }
88
+ }
89
+ const addedDeps = difference(updatedDeps, initialDeps);
90
+ for (const addedDep of addedDeps) {
91
+ if (!pkgsDiff[depType][`+${addedDep}`]) {
92
+ pkgsDiff[depType][`+${addedDep}`] = {
93
+ added: true,
94
+ name: addedDep,
95
+ version: updatedPackageManifest[prop]?.[addedDep],
96
+ };
97
+ }
98
+ }
99
+ }
100
+ return pkgsDiff;
101
+ }));
102
+ }
103
+ function removeOptionalFromProdDeps(pkg) {
104
+ if ((pkg.dependencies == null) || (pkg.optionalDependencies == null))
105
+ return pkg;
106
+ for (const depName of Object.keys(pkg.dependencies)) {
107
+ if (pkg.optionalDependencies[depName]) {
108
+ delete pkg.dependencies[depName];
109
+ }
110
+ }
111
+ return pkg;
112
+ }
113
+ //# sourceMappingURL=pkgsDiff.js.map
@@ -0,0 +1,8 @@
1
+ import type { FetchingProgressLog } from '@pnpm/core-loggers';
2
+ import type * as Rx from 'rxjs';
3
+ export declare function reportBigTarballProgress(log$: {
4
+ fetchingProgress: Rx.Observable<FetchingProgressLog>;
5
+ }): Rx.Observable<Rx.Observable<{
6
+ fixed: boolean;
7
+ msg: string;
8
+ }>>;
@@ -0,0 +1,26 @@
1
+ import prettyBytes from 'pretty-bytes';
2
+ import { filter, map, startWith } from 'rxjs/operators';
3
+ import { hlValue, } from './outputConstants.js';
4
+ const BIG_TARBALL_SIZE = 1024 * 1024 * 5; // 5 MB
5
+ const PRETTY_OPTS = {
6
+ minimumFractionDigits: 2,
7
+ maximumFractionDigits: 2,
8
+ };
9
+ export function reportBigTarballProgress(log$) {
10
+ return log$.fetchingProgress.pipe(filter((log) => log.status === 'started' &&
11
+ typeof log.size === 'number' && log.size >= BIG_TARBALL_SIZE &&
12
+ // When retrying the download, keep the existing progress line.
13
+ // Fixing issue: https://github.com/pnpm/pnpm/issues/1013
14
+ log.attempt === 1), map((startedLog) => {
15
+ const size = prettyBytes(startedLog.size ?? 0, PRETTY_OPTS);
16
+ return log$.fetchingProgress.pipe(filter((log) => log.status === 'in_progress' && log.packageId === startedLog['packageId']), map((log) => log.downloaded ?? 0), startWith(0), map((downloadedRaw) => {
17
+ const done = startedLog.size === downloadedRaw;
18
+ const downloaded = prettyBytes(downloadedRaw, PRETTY_OPTS);
19
+ return {
20
+ fixed: !done,
21
+ msg: `Downloading ${startedLog['packageId']}: ${hlValue(downloaded)}/${hlValue(size)}${done ? ', done' : ''}`,
22
+ };
23
+ }));
24
+ }));
25
+ }
26
+ //# sourceMappingURL=reportBigTarballsProgress.js.map
@@ -0,0 +1,10 @@
1
+ import type { ContextLog, PackageImportMethodLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportContext(log$: {
4
+ context: Rx.Observable<ContextLog>;
5
+ packageImportMethod: Rx.Observable<PackageImportMethodLog>;
6
+ }, opts: {
7
+ cwd: string;
8
+ }): Rx.Observable<Rx.Observable<{
9
+ msg: string;
10
+ }>>;
@@ -0,0 +1,34 @@
1
+ import path from 'node:path';
2
+ import normalize from 'normalize-path';
3
+ import * as Rx from 'rxjs';
4
+ import { map, take } from 'rxjs/operators';
5
+ export function reportContext(log$, opts) {
6
+ return Rx.combineLatest(log$.context.pipe(take(1)), log$.packageImportMethod.pipe(take(1)))
7
+ .pipe(map(([context, packageImportMethod]) => {
8
+ if (context.currentLockfileExists) {
9
+ return Rx.NEVER;
10
+ }
11
+ let method;
12
+ switch (packageImportMethod.method) {
13
+ case 'copy':
14
+ method = 'copied';
15
+ break;
16
+ case 'clone':
17
+ method = 'cloned';
18
+ break;
19
+ case 'hardlink':
20
+ method = 'hard linked';
21
+ break;
22
+ default:
23
+ method = packageImportMethod.method;
24
+ break;
25
+ }
26
+ return Rx.of({
27
+ msg: `\
28
+ Packages are ${method} from the content-addressable store to the virtual store.
29
+ Content-addressable store is at: ${context.storeDir}
30
+ Virtual store is at: ${normalize(path.relative(opts.cwd, context.virtualStoreDir))}`,
31
+ });
32
+ }));
33
+ }
34
+ //# sourceMappingURL=reportContext.js.map
@@ -0,0 +1,11 @@
1
+ import type { DeprecationLog, StageLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportDeprecations(log$: {
4
+ deprecation: Rx.Observable<DeprecationLog>;
5
+ stage: Rx.Observable<StageLog>;
6
+ }, opts: {
7
+ cwd: string;
8
+ isRecursive: boolean;
9
+ }): Rx.Observable<Rx.Observable<{
10
+ msg: string;
11
+ }>>;
@@ -0,0 +1,27 @@
1
+ import chalk from 'chalk';
2
+ import * as Rx from 'rxjs';
3
+ import { buffer, filter, map, switchMap } from 'rxjs/operators';
4
+ import { formatWarn } from './utils/formatWarn.js';
5
+ import { zoomOut } from './utils/zooming.js';
6
+ export function reportDeprecations(log$, opts) {
7
+ const [deprecatedDirectDeps$, deprecatedSubdeps$] = Rx.partition(log$.deprecation, (log) => log.depth === 0);
8
+ const resolutionDone$ = log$.stage.pipe(filter((log) => log.stage === 'resolution_done'));
9
+ return Rx.merge(deprecatedDirectDeps$.pipe(map((log) => {
10
+ if (!opts.isRecursive && log.prefix === opts.cwd) {
11
+ return Rx.of({
12
+ msg: formatWarn(`${chalk.red('deprecated')} ${log.pkgName}@${log.pkgVersion}: ${log.deprecated}`),
13
+ });
14
+ }
15
+ return Rx.of({
16
+ msg: zoomOut(opts.cwd, log.prefix, formatWarn(`${chalk.red('deprecated')} ${log.pkgName}@${log.pkgVersion}`)),
17
+ });
18
+ })), deprecatedSubdeps$.pipe(buffer(resolutionDone$), switchMap(deprecatedSubdeps => {
19
+ if (deprecatedSubdeps.length > 0) {
20
+ return Rx.of(Rx.of({
21
+ msg: formatWarn(`${chalk.red(`${deprecatedSubdeps.length} deprecated subdependencies found:`)} ${deprecatedSubdeps.map(log => `${log.pkgName}@${log.pkgVersion}`).sort().join(', ')}`),
22
+ }));
23
+ }
24
+ return Rx.EMPTY;
25
+ })));
26
+ }
27
+ //# sourceMappingURL=reportDeprecations.js.map
@@ -0,0 +1,6 @@
1
+ import type { ExecutionTimeLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportExecutionTime(executionTime$: Rx.Observable<ExecutionTimeLog>): Rx.Observable<Rx.Observable<{
4
+ fixed: boolean;
5
+ msg: string;
6
+ }>>;
@@ -0,0 +1,13 @@
1
+ import { packageManager } from '@pnpm/cli.meta';
2
+ import prettyMs from 'pretty-ms';
3
+ import * as Rx from 'rxjs';
4
+ import { map, take } from 'rxjs/operators';
5
+ export function reportExecutionTime(executionTime$) {
6
+ return executionTime$.pipe(take(1), map((log) => {
7
+ return Rx.of({
8
+ fixed: true, // Without this, for some reason sometimes the progress bar is printed after the execution time
9
+ msg: `Done in ${prettyMs(log.endedAt - log.startedAt)} using ${packageManager.name} v${packageManager.version}`,
10
+ });
11
+ }));
12
+ }
13
+ //# sourceMappingURL=reportExecutionTime.js.map
@@ -0,0 +1,8 @@
1
+ import type { HookLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportHooks(hook$: Rx.Observable<HookLog>, opts: {
4
+ cwd: string;
5
+ isRecursive: boolean;
6
+ }): Rx.Observable<Rx.Observable<{
7
+ msg: string;
8
+ }>>;
@@ -0,0 +1,12 @@
1
+ import chalk from 'chalk';
2
+ import * as Rx from 'rxjs';
3
+ import { map } from 'rxjs/operators';
4
+ import { autozoom } from './utils/zooming.js';
5
+ export function reportHooks(hook$, opts) {
6
+ return hook$.pipe(map((log) => Rx.of({
7
+ msg: autozoom(opts.cwd, log.prefix, `${chalk.magentaBright(log.hook)}: ${log.message}`, {
8
+ zoomOutCurrent: opts.isRecursive,
9
+ }),
10
+ })));
11
+ }
12
+ //# sourceMappingURL=reportHooks.js.map
@@ -0,0 +1,11 @@
1
+ import type { Config, ConfigContext } from '@pnpm/config.reader';
2
+ import type { IgnoredScriptsLog } from '@pnpm/core-loggers';
3
+ import * as Rx from 'rxjs';
4
+ export declare function reportIgnoredBuilds(log$: {
5
+ ignoredScripts: Rx.Observable<IgnoredScriptsLog>;
6
+ }, opts: {
7
+ pnpmConfig?: Config & ConfigContext;
8
+ approveBuildsInstructionText?: string;
9
+ }): Rx.Observable<Rx.Observable<{
10
+ msg: string;
11
+ }>>;
@@ -0,0 +1,21 @@
1
+ import { lexCompare } from '@pnpm/util.lex-comparator';
2
+ import boxen from 'boxen';
3
+ import * as Rx from 'rxjs';
4
+ import { map } from 'rxjs/operators';
5
+ export function reportIgnoredBuilds(log$, opts) {
6
+ return log$.ignoredScripts.pipe(map((ignoredScripts) => {
7
+ if (ignoredScripts.packageNames && ignoredScripts.packageNames.length > 0 && !opts.pnpmConfig?.strictDepBuilds) {
8
+ const msg = boxen(`Ignored build scripts: ${Array.from(ignoredScripts.packageNames).sort(lexCompare).join(', ')}.
9
+ ${opts.approveBuildsInstructionText ?? `Run "pnpm approve-builds${opts.pnpmConfig?.cliOptions?.global ? ' -g' : ''}" to pick which dependencies should be allowed to run scripts.`}`, {
10
+ title: 'Warning',
11
+ padding: 1,
12
+ margin: 0,
13
+ borderStyle: 'round',
14
+ borderColor: 'yellow',
15
+ });
16
+ return Rx.of({ msg });
17
+ }
18
+ return Rx.NEVER;
19
+ }));
20
+ }
21
+ //# sourceMappingURL=reportIgnoredBuilds.js.map
@@ -0,0 +1,7 @@
1
+ import type { InstallCheckLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportInstallChecks(installCheck$: Rx.Observable<InstallCheckLog>, opts: {
4
+ cwd: string;
5
+ }): Rx.Observable<Rx.Observable<{
6
+ msg: string;
7
+ }>>;
@@ -0,0 +1,19 @@
1
+ import * as Rx from 'rxjs';
2
+ import { filter, map } from 'rxjs/operators';
3
+ import { formatWarn } from './utils/formatWarn.js';
4
+ import { autozoom } from './utils/zooming.js';
5
+ export function reportInstallChecks(installCheck$, opts) {
6
+ return installCheck$.pipe(map((log) => formatInstallCheck(opts.cwd, log)), filter(Boolean), map((msg) => Rx.of({ msg })));
7
+ }
8
+ function formatInstallCheck(currentPrefix, logObj, opts) {
9
+ const zoomOutCurrent = opts?.zoomOutCurrent ?? false;
10
+ switch (logObj.code) {
11
+ case 'EBADPLATFORM':
12
+ return autozoom(currentPrefix, logObj.prefix, formatWarn(`Unsupported system. Skipping dependency ${logObj.pkgId}`), { zoomOutCurrent });
13
+ case 'ENOTSUP':
14
+ return autozoom(currentPrefix, logObj.prefix, logObj.toString(), { zoomOutCurrent });
15
+ default:
16
+ return undefined;
17
+ }
18
+ }
19
+ //# sourceMappingURL=reportInstallChecks.js.map
@@ -0,0 +1,5 @@
1
+ import type { InstallingConfigDepsLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportInstallingConfigDeps(installingConfigDeps$: Rx.Observable<InstallingConfigDepsLog>): Rx.Observable<Rx.Observable<{
4
+ msg: string;
5
+ }>>;
@@ -0,0 +1,18 @@
1
+ import * as Rx from 'rxjs';
2
+ import { map } from 'rxjs/operators';
3
+ export function reportInstallingConfigDeps(installingConfigDeps$) {
4
+ return Rx.of(installingConfigDeps$.pipe(map((log) => {
5
+ switch (log.status) {
6
+ case 'started': {
7
+ return {
8
+ msg: 'Installing config dependencies...',
9
+ };
10
+ }
11
+ case 'done':
12
+ return {
13
+ msg: `Installed config dependencies: ${log.deps.map(({ name, version }) => `${name}@${version}`).join(', ')}`,
14
+ };
15
+ }
16
+ })));
17
+ }
18
+ //# sourceMappingURL=reportInstallingConfigDeps.js.map
@@ -0,0 +1,13 @@
1
+ import type { LifecycleLog } from '@pnpm/core-loggers';
2
+ import * as Rx from 'rxjs';
3
+ export declare function reportLifecycleScripts(log$: {
4
+ lifecycle: Rx.Observable<LifecycleLog>;
5
+ }, opts: {
6
+ appendOnly?: boolean;
7
+ aggregateOutput?: boolean;
8
+ hideLifecyclePrefix?: boolean;
9
+ cwd: string;
10
+ width: number;
11
+ }): Rx.Observable<Rx.Observable<{
12
+ msg: string;
13
+ }>>;