@pnpm/cli.default-reporter 1002.0.11 → 1100.0.1
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/lib/index.d.ts +3 -3
- package/lib/reportError.js +5 -13
- package/lib/reporterForClient/index.d.ts +2 -2
- package/lib/reporterForClient/reportIgnoredBuilds.d.ts +2 -2
- package/lib/reporterForClient/reportPeerDependencyIssues.js +2 -7
- package/lib/reporterForClient/reportRequestRetry.js +4 -1
- package/package.json +19 -20
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from '@pnpm/config.reader';
|
|
1
|
+
import type { Config, ConfigContext } from '@pnpm/config.reader';
|
|
2
2
|
import type * as logs from '@pnpm/core-loggers';
|
|
3
3
|
import type { LogLevel, StreamParser } from '@pnpm/logger';
|
|
4
4
|
import * as Rx from 'rxjs';
|
|
@@ -23,7 +23,7 @@ export declare function initDefaultReporter(opts: {
|
|
|
23
23
|
};
|
|
24
24
|
context: {
|
|
25
25
|
argv: string[];
|
|
26
|
-
config?: Config;
|
|
26
|
+
config?: Config & ConfigContext;
|
|
27
27
|
env?: NodeJS.ProcessEnv;
|
|
28
28
|
process?: NodeJS.Process;
|
|
29
29
|
};
|
|
@@ -46,7 +46,7 @@ export declare function toOutput$(opts: {
|
|
|
46
46
|
};
|
|
47
47
|
context: {
|
|
48
48
|
argv: string[];
|
|
49
|
-
config?: Config;
|
|
49
|
+
config?: Config & ConfigContext;
|
|
50
50
|
env?: NodeJS.ProcessEnv;
|
|
51
51
|
process?: NodeJS.Process;
|
|
52
52
|
};
|
package/lib/reportError.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { renderDedupeCheckIssues } from '@pnpm/installing.dedupe.issues-renderer';
|
|
2
|
-
import { renderPeerIssues } from '@pnpm/installing.render-peer-issues';
|
|
3
2
|
import chalk from 'chalk';
|
|
4
3
|
import { equals } from 'ramda';
|
|
5
4
|
import StackTracey from 'stacktracey';
|
|
@@ -306,7 +305,7 @@ To fix this issue, install the required Node version.`;
|
|
|
306
305
|
}
|
|
307
306
|
function reportAuthError(err, msg, config) {
|
|
308
307
|
const foundSettings = [];
|
|
309
|
-
for (const [key, value] of Object.entries(config?.
|
|
308
|
+
for (const [key, value] of Object.entries(config?.authConfig ?? {})) {
|
|
310
309
|
if (key[0] === '@') {
|
|
311
310
|
foundSettings.push(`${key}=${String(value)}`);
|
|
312
311
|
continue;
|
|
@@ -342,7 +341,9 @@ function hideSecureInfo(key, value) {
|
|
|
342
341
|
}
|
|
343
342
|
function reportPeerDependencyIssuesError(err, msg) {
|
|
344
343
|
const hasMissingPeers = getHasMissingPeers(msg.issuesByProjects);
|
|
345
|
-
const hints = [
|
|
344
|
+
const hints = [
|
|
345
|
+
'Run "pnpm peers check" to list the peer dependency issues.',
|
|
346
|
+
];
|
|
346
347
|
if (hasMissingPeers) {
|
|
347
348
|
hints.push(`To auto-install peer dependencies, add the following to "pnpm-workspace.yaml" in your project root:
|
|
348
349
|
|
|
@@ -352,18 +353,9 @@ function reportPeerDependencyIssuesError(err, msg) {
|
|
|
352
353
|
|
|
353
354
|
strictPeerDependencies: false
|
|
354
355
|
`);
|
|
355
|
-
const rendered = renderPeerIssues(msg.issuesByProjects);
|
|
356
|
-
if (!rendered) {
|
|
357
|
-
// This should never happen.
|
|
358
|
-
return {
|
|
359
|
-
title: err.message,
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
356
|
return {
|
|
363
357
|
title: err.message,
|
|
364
|
-
body:
|
|
365
|
-
${hints.map((hint) => `hint: ${hint}`).join('\n')}
|
|
366
|
-
`,
|
|
358
|
+
body: hints.map((hint) => `hint: ${hint}`).join('\n'),
|
|
367
359
|
};
|
|
368
360
|
}
|
|
369
361
|
function getHasMissingPeers(issuesByProjects) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from '@pnpm/config.reader';
|
|
1
|
+
import type { Config, ConfigContext } from '@pnpm/config.reader';
|
|
2
2
|
import type * as logs from '@pnpm/core-loggers';
|
|
3
3
|
import type { LogLevel } from '@pnpm/logger';
|
|
4
4
|
import type * as Rx from 'rxjs';
|
|
@@ -37,7 +37,7 @@ export declare function reporterForClient(log$: {
|
|
|
37
37
|
process: NodeJS.Process;
|
|
38
38
|
isRecursive: boolean;
|
|
39
39
|
logLevel?: LogLevel;
|
|
40
|
-
pnpmConfig?: Config;
|
|
40
|
+
pnpmConfig?: Config & ConfigContext;
|
|
41
41
|
streamLifecycleOutput?: boolean;
|
|
42
42
|
aggregateOutput?: boolean;
|
|
43
43
|
throttleProgress?: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Config } from '@pnpm/config.reader';
|
|
1
|
+
import type { Config, ConfigContext } from '@pnpm/config.reader';
|
|
2
2
|
import type { IgnoredScriptsLog } from '@pnpm/core-loggers';
|
|
3
3
|
import * as Rx from 'rxjs';
|
|
4
4
|
export declare function reportIgnoredBuilds(log$: {
|
|
5
5
|
ignoredScripts: Rx.Observable<IgnoredScriptsLog>;
|
|
6
6
|
}, opts: {
|
|
7
|
-
pnpmConfig?: Config;
|
|
7
|
+
pnpmConfig?: Config & ConfigContext;
|
|
8
8
|
approveBuildsInstructionText?: string;
|
|
9
9
|
}): Rx.Observable<Rx.Observable<{
|
|
10
10
|
msg: string;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { renderPeerIssues } from '@pnpm/installing.render-peer-issues';
|
|
2
1
|
import * as Rx from 'rxjs';
|
|
3
2
|
import { map, take } from 'rxjs/operators';
|
|
4
3
|
import { formatWarn } from './utils/formatWarn.js';
|
|
5
4
|
export function reportPeerDependencyIssues(log$) {
|
|
6
|
-
return log$.peerDependencyIssues.pipe(take(1), map((
|
|
7
|
-
const renderedPeerIssues = renderPeerIssues(log.issuesByProjects);
|
|
8
|
-
if (!renderedPeerIssues) {
|
|
9
|
-
return Rx.NEVER;
|
|
10
|
-
}
|
|
5
|
+
return log$.peerDependencyIssues.pipe(take(1), map(() => {
|
|
11
6
|
return Rx.of({
|
|
12
|
-
msg:
|
|
7
|
+
msg: formatWarn('Issues with peer dependencies found. Run "pnpm peers check" to list them.'),
|
|
13
8
|
});
|
|
14
9
|
}));
|
|
15
10
|
}
|
|
@@ -5,7 +5,10 @@ import { formatWarn } from './utils/formatWarn.js';
|
|
|
5
5
|
export function reportRequestRetry(requestRetry$) {
|
|
6
6
|
return requestRetry$.pipe(map((log) => {
|
|
7
7
|
const retriesLeft = log.maxRetries - log.attempt + 1;
|
|
8
|
-
|
|
8
|
+
// Extract error code from various possible locations
|
|
9
|
+
// HTTP status codes are numeric, system error codes are strings
|
|
10
|
+
const errorCode = log.error.status ?? log.error.statusCode ?? log.error.code ?? log.error.errno ??
|
|
11
|
+
log.error.cause?.code ?? log.error.cause?.errno ?? 'unknown';
|
|
9
12
|
const msg = `${log.method} ${log.url} error (${errorCode}). \
|
|
10
13
|
Will retry in ${prettyMilliseconds(log.timeout, { verbose: true })}. \
|
|
11
14
|
${retriesLeft} retries left.`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/cli.default-reporter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1100.0.1",
|
|
4
4
|
"description": "The default reporter of pnpm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -29,36 +29,35 @@
|
|
|
29
29
|
"ansi-diff": "^1.2.0",
|
|
30
30
|
"boxen": "npm:@zkochan/boxen@5.1.2",
|
|
31
31
|
"chalk": "^5.6.0",
|
|
32
|
-
"cli-truncate": "^
|
|
32
|
+
"cli-truncate": "^5.2.0",
|
|
33
33
|
"normalize-path": "^3.0.0",
|
|
34
|
-
"pretty-bytes": "^7.0
|
|
34
|
+
"pretty-bytes": "^7.1.0",
|
|
35
35
|
"pretty-ms": "^9.2.0",
|
|
36
36
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
37
37
|
"rxjs": "^7.8.2",
|
|
38
38
|
"semver": "^7.7.2",
|
|
39
|
-
"stacktracey": "^2.
|
|
40
|
-
"string-length": "^
|
|
41
|
-
"@pnpm/cli.meta": "
|
|
42
|
-
"@pnpm/config.reader": "
|
|
43
|
-
"@pnpm/
|
|
44
|
-
"@pnpm/
|
|
45
|
-
"@pnpm/installing.dedupe.issues-renderer": "
|
|
46
|
-
"@pnpm/installing.dedupe.types": "
|
|
47
|
-
"@pnpm/
|
|
48
|
-
"@pnpm/types": "1000.9.0"
|
|
39
|
+
"stacktracey": "^2.2.0",
|
|
40
|
+
"string-length": "^7.0.1",
|
|
41
|
+
"@pnpm/cli.meta": "1100.0.1",
|
|
42
|
+
"@pnpm/config.reader": "1100.0.1",
|
|
43
|
+
"@pnpm/core-loggers": "1100.0.1",
|
|
44
|
+
"@pnpm/error": "1100.0.0",
|
|
45
|
+
"@pnpm/installing.dedupe.issues-renderer": "1100.0.0",
|
|
46
|
+
"@pnpm/installing.dedupe.types": "1100.0.0",
|
|
47
|
+
"@pnpm/types": "1101.0.0"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"@pnpm/logger": ">=1001.0.0 <1002.0.0"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@types/normalize-path": "^3.0.2",
|
|
55
|
-
"@types/ramda": "0.
|
|
54
|
+
"@types/ramda": "0.31.1",
|
|
56
55
|
"@types/semver": "7.7.1",
|
|
57
56
|
"ghooks": "2.0.4",
|
|
58
57
|
"load-json-file": "^7.0.1",
|
|
59
|
-
"normalize-newline": "
|
|
60
|
-
"@pnpm/
|
|
61
|
-
"@pnpm/
|
|
58
|
+
"normalize-newline": "5.0.0",
|
|
59
|
+
"@pnpm/cli.default-reporter": "1100.0.1",
|
|
60
|
+
"@pnpm/logger": "1100.0.0"
|
|
62
61
|
},
|
|
63
62
|
"engines": {
|
|
64
63
|
"node": ">=22.13"
|
|
@@ -69,8 +68,8 @@
|
|
|
69
68
|
"scripts": {
|
|
70
69
|
"start": "tsgo --watch",
|
|
71
70
|
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
71
|
+
"test": "pn compile && pn .test",
|
|
72
|
+
"compile": "tsgo --build && pn lint --fix",
|
|
73
|
+
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
|
|
75
74
|
}
|
|
76
75
|
}
|