@pnpm/cli.default-reporter 1100.3.6 → 1100.3.8

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 (62) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/lib/index.js +20 -1
  3. package/package.json +7 -7
  4. package/lib/cli.d.ts +0 -1
  5. package/lib/cli.js +0 -50
  6. package/lib/constants.d.ts +0 -1
  7. package/lib/constants.js +0 -4
  8. package/lib/index.d.ts +0 -54
  9. package/lib/mergeOutputs.d.ts +0 -4
  10. package/lib/mergeOutputs.js +0 -69
  11. package/lib/reportError.d.ts +0 -3
  12. package/lib/reportError.js +0 -426
  13. package/lib/reporterForClient/index.d.ts +0 -53
  14. package/lib/reporterForClient/index.js +0 -98
  15. package/lib/reporterForClient/outputConstants.d.ts +0 -4
  16. package/lib/reporterForClient/outputConstants.js +0 -6
  17. package/lib/reporterForClient/pkgsDiff.d.ts +0 -36
  18. package/lib/reporterForClient/pkgsDiff.js +0 -113
  19. package/lib/reporterForClient/reportBigTarballsProgress.d.ts +0 -8
  20. package/lib/reporterForClient/reportBigTarballsProgress.js +0 -26
  21. package/lib/reporterForClient/reportContext.d.ts +0 -10
  22. package/lib/reporterForClient/reportContext.js +0 -34
  23. package/lib/reporterForClient/reportDeprecations.d.ts +0 -11
  24. package/lib/reporterForClient/reportDeprecations.js +0 -27
  25. package/lib/reporterForClient/reportExecutionTime.d.ts +0 -6
  26. package/lib/reporterForClient/reportExecutionTime.js +0 -13
  27. package/lib/reporterForClient/reportHooks.d.ts +0 -8
  28. package/lib/reporterForClient/reportHooks.js +0 -12
  29. package/lib/reporterForClient/reportIgnoredBuilds.d.ts +0 -11
  30. package/lib/reporterForClient/reportIgnoredBuilds.js +0 -21
  31. package/lib/reporterForClient/reportInstallChecks.d.ts +0 -7
  32. package/lib/reporterForClient/reportInstallChecks.js +0 -19
  33. package/lib/reporterForClient/reportInstallingConfigDeps.d.ts +0 -5
  34. package/lib/reporterForClient/reportInstallingConfigDeps.js +0 -18
  35. package/lib/reporterForClient/reportLifecycleScripts.d.ts +0 -13
  36. package/lib/reporterForClient/reportLifecycleScripts.js +0 -197
  37. package/lib/reporterForClient/reportLockfileVerification.d.ts +0 -15
  38. package/lib/reporterForClient/reportLockfileVerification.js +0 -73
  39. package/lib/reporterForClient/reportMisc.d.ts +0 -17
  40. package/lib/reporterForClient/reportMisc.js +0 -69
  41. package/lib/reporterForClient/reportPeerDependencyIssues.d.ts +0 -7
  42. package/lib/reporterForClient/reportPeerDependencyIssues.js +0 -11
  43. package/lib/reporterForClient/reportProgress.d.ts +0 -16
  44. package/lib/reporterForClient/reportProgress.js +0 -123
  45. package/lib/reporterForClient/reportRequestRetry.d.ts +0 -5
  46. package/lib/reporterForClient/reportRequestRetry.js +0 -18
  47. package/lib/reporterForClient/reportScope.d.ts +0 -8
  48. package/lib/reporterForClient/reportScope.js +0 -41
  49. package/lib/reporterForClient/reportSkippedOptionalDependencies.d.ts +0 -7
  50. package/lib/reporterForClient/reportSkippedOptionalDependencies.js +0 -8
  51. package/lib/reporterForClient/reportStats.d.ts +0 -13
  52. package/lib/reporterForClient/reportStats.js +0 -143
  53. package/lib/reporterForClient/reportSummary.d.ts +0 -19
  54. package/lib/reporterForClient/reportSummary.js +0 -79
  55. package/lib/reporterForClient/reportUpdateCheck.d.ts +0 -8
  56. package/lib/reporterForClient/reportUpdateCheck.js +0 -42
  57. package/lib/reporterForClient/utils/formatPrefix.d.ts +0 -2
  58. package/lib/reporterForClient/utils/formatPrefix.js +0 -19
  59. package/lib/reporterForClient/utils/formatWarn.d.ts +0 -1
  60. package/lib/reporterForClient/utils/formatWarn.js +0 -5
  61. package/lib/reporterForClient/utils/zooming.d.ts +0 -4
  62. package/lib/reporterForClient/utils/zooming.js +0 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @pnpm/default-reporter
2
2
 
3
+ ## 1100.3.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Keep the interactive `minimumReleaseAge` approval prompt visible during `pnpm install`. The progress reporter now pauses its redraws while a prompt is waiting for input instead of overwriting it, so the install no longer hangs on a question the user cannot see [#13019](https://github.com/pnpm/pnpm/issues/13019).
8
+
9
+ - Updated dependencies:
10
+ - @pnpm/config.reader@1101.12.1
11
+ - @pnpm/core-loggers@1100.2.3
12
+
13
+ ## 1100.3.7
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies:
18
+ - @pnpm/cli.meta@1100.0.9
19
+ - @pnpm/config.reader@1101.12.0
20
+ - @pnpm/core-loggers@1100.2.2
21
+ - @pnpm/deps.inspection.peers-issues-renderer@1100.0.7
22
+ - @pnpm/types@1101.4.0
23
+
3
24
  ## 1100.3.6
4
25
 
5
26
  ### Patch Changes
package/lib/index.js CHANGED
@@ -38,10 +38,26 @@ export function initDefaultReporter(opts) {
38
38
  }
39
39
  const stream = opts.useStderr ? proc.stderr : proc.stdout;
40
40
  const write = stream.write.bind(stream);
41
- const diff = createDiffer({
41
+ const newDiffer = () => createDiffer({
42
42
  height: stream.rows,
43
43
  width: stream.columns ?? outputMaxWidth,
44
44
  });
45
+ let diff = newDiffer();
46
+ // Hold redraws while an interactive prompt owns the terminal (see PromptMessage).
47
+ let promptActive = false;
48
+ const onLog = (log) => {
49
+ if (log.name !== 'pnpm:prompt')
50
+ return;
51
+ if (log.action === 'start') {
52
+ promptActive = true;
53
+ }
54
+ else {
55
+ promptActive = false;
56
+ // Drop the differ's now-stale frame: the terminal below it changed while paused.
57
+ diff = newDiffer();
58
+ }
59
+ };
60
+ opts.streamParser.on('data', onLog);
45
61
  const subscription = output$
46
62
  .subscribe({
47
63
  complete() { }, // eslint-disable-line:no-empty
@@ -51,6 +67,8 @@ export function initDefaultReporter(opts) {
51
67
  next: logUpdate,
52
68
  });
53
69
  function logUpdate(view) {
70
+ if (promptActive)
71
+ return;
54
72
  // A new line should always be appended in case a prompt needs to appear.
55
73
  // Without a new line the prompt will be joined with the previous output.
56
74
  // An example of such prompt may be seen by running: pnpm update --interactive
@@ -68,6 +86,7 @@ export function initDefaultReporter(opts) {
68
86
  }
69
87
  return () => {
70
88
  subscription.unsubscribe();
89
+ opts.streamParser.removeListener('data', onLog);
71
90
  };
72
91
  }
73
92
  export function toOutput$(opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/cli.default-reporter",
3
- "version": "1100.3.6",
3
+ "version": "1100.3.8",
4
4
  "description": "The default reporter of pnpm",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -32,14 +32,14 @@
32
32
  "pnpm-render": "bin/pnpm-render.mjs"
33
33
  },
34
34
  "dependencies": {
35
- "@pnpm/cli.meta": "1100.0.8",
36
- "@pnpm/config.reader": "1101.11.2",
37
- "@pnpm/core-loggers": "1100.2.1",
38
- "@pnpm/deps.inspection.peers-issues-renderer": "1100.0.6",
35
+ "@pnpm/cli.meta": "1100.0.9",
36
+ "@pnpm/config.reader": "1101.12.1",
37
+ "@pnpm/core-loggers": "1100.2.3",
38
+ "@pnpm/deps.inspection.peers-issues-renderer": "1100.0.7",
39
39
  "@pnpm/error": "1100.0.1",
40
40
  "@pnpm/installing.dedupe.issues-renderer": "1100.0.1",
41
41
  "@pnpm/installing.dedupe.types": "1100.0.1",
42
- "@pnpm/types": "1101.3.2",
42
+ "@pnpm/types": "1101.4.0",
43
43
  "@pnpm/util.lex-comparator": "^4.0.1",
44
44
  "ansi-diff": "^1.2.0",
45
45
  "boxen": "npm:@zkochan/boxen@5.1.2",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@jest/globals": "30.4.1",
62
- "@pnpm/cli.default-reporter": "1100.3.6",
62
+ "@pnpm/cli.default-reporter": "1100.3.8",
63
63
  "@pnpm/logger": "1100.0.0",
64
64
  "@types/normalize-path": "^3.0.2",
65
65
  "@types/ramda": "0.31.1",
package/lib/cli.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function runCli(argv: readonly string[]): Promise<void>;
package/lib/cli.js DELETED
@@ -1,50 +0,0 @@
1
- import { EventEmitter } from 'node:events';
2
- import readline from 'node:readline';
3
- import { initDefaultReporter } from './index.js';
4
- export async function runCli(argv) {
5
- const cmd = argv[0] ?? 'install';
6
- const emitter = new EventEmitter();
7
- const streamParser = {
8
- on: (event, reporter) => {
9
- emitter.on(event, reporter);
10
- },
11
- removeListener: (event, reporter) => {
12
- emitter.removeListener(event, reporter);
13
- },
14
- };
15
- const close = initDefaultReporter({
16
- streamParser,
17
- context: { argv: [cmd] },
18
- reportingOptions: {
19
- throttleProgress: 200,
20
- },
21
- });
22
- // initDefaultReporter registers its 'data' listener via setTimeout(0); wait
23
- // a tick so events emitted from the readline loop below aren't dropped.
24
- await new Promise((resolve) => {
25
- setTimeout(resolve, 0);
26
- });
27
- try {
28
- const rl = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
29
- for await (const line of rl) {
30
- if (!line)
31
- continue;
32
- let parsed;
33
- try {
34
- parsed = JSON.parse(line);
35
- }
36
- catch {
37
- continue;
38
- }
39
- // Guard against valid JSON that isn't a log object (e.g. `null`,
40
- // numbers, strings) — the reporter dispatches on `log.name`.
41
- if (parsed == null || typeof parsed !== 'object')
42
- continue;
43
- emitter.emit('data', parsed);
44
- }
45
- }
46
- finally {
47
- close();
48
- }
49
- }
50
- //# sourceMappingURL=cli.js.map
@@ -1 +0,0 @@
1
- export declare const EOL = "\n";
package/lib/constants.js DELETED
@@ -1,4 +0,0 @@
1
- // In terminals, always Unix line endings are used
2
- // even on Windows
3
- export const EOL = '\n';
4
- //# sourceMappingURL=constants.js.map
package/lib/index.d.ts DELETED
@@ -1,54 +0,0 @@
1
- import type { Config, ConfigContext } from '@pnpm/config.reader';
2
- import type * as logs from '@pnpm/core-loggers';
3
- import type { LogLevel, StreamParser } from '@pnpm/logger';
4
- import * as Rx from 'rxjs';
5
- import type { FilterPkgsDiff } from './reporterForClient/reportSummary.js';
6
- import { formatWarn } from './reporterForClient/utils/formatWarn.js';
7
- export { formatWarn };
8
- export declare function initDefaultReporter(opts: {
9
- useStderr?: boolean;
10
- streamParser: StreamParser<logs.Log>;
11
- reportingOptions?: {
12
- appendOnly?: boolean;
13
- logLevel?: LogLevel;
14
- streamLifecycleOutput?: boolean;
15
- aggregateOutput?: boolean;
16
- throttleProgress?: number;
17
- outputMaxWidth?: number;
18
- hideAddedPkgsProgress?: boolean;
19
- hideProgressPrefix?: boolean;
20
- hideLifecycleOutput?: boolean;
21
- hideLifecyclePrefix?: boolean;
22
- approveBuildsInstructionText?: string;
23
- };
24
- context: {
25
- argv: string[];
26
- config?: Config & ConfigContext;
27
- env?: NodeJS.ProcessEnv;
28
- process?: NodeJS.Process;
29
- };
30
- filterPkgsDiff?: FilterPkgsDiff;
31
- }): () => void;
32
- export declare function toOutput$(opts: {
33
- streamParser: StreamParser<logs.Log>;
34
- reportingOptions?: {
35
- appendOnly?: boolean;
36
- logLevel?: LogLevel;
37
- outputMaxWidth?: number;
38
- streamLifecycleOutput?: boolean;
39
- aggregateOutput?: boolean;
40
- throttleProgress?: number;
41
- hideAddedPkgsProgress?: boolean;
42
- hideProgressPrefix?: boolean;
43
- hideLifecycleOutput?: boolean;
44
- hideLifecyclePrefix?: boolean;
45
- approveBuildsInstructionText?: string;
46
- };
47
- context: {
48
- argv: string[];
49
- config?: Config & ConfigContext;
50
- env?: NodeJS.ProcessEnv;
51
- process?: NodeJS.Process;
52
- };
53
- filterPkgsDiff?: FilterPkgsDiff;
54
- }): Rx.Observable<string>;
@@ -1,4 +0,0 @@
1
- import * as Rx from 'rxjs';
2
- export declare function mergeOutputs(outputs: Array<Rx.Observable<Rx.Observable<{
3
- msg: string;
4
- }>>>): Rx.Observable<string>;
@@ -1,69 +0,0 @@
1
- import * as Rx from 'rxjs';
2
- import { filter, map, mergeAll, scan } from 'rxjs/operators';
3
- import { EOL } from './constants.js';
4
- export function mergeOutputs(outputs) {
5
- let blockNo = 0;
6
- let fixedBlockNo = 0;
7
- let started = false;
8
- let previousOutput = null;
9
- return Rx.merge(...outputs).pipe(map((log) => {
10
- let currentBlockNo = -1;
11
- let currentFixedBlockNo = -1;
12
- return log.pipe(map((msg) => {
13
- if (msg.fixed) {
14
- if (currentFixedBlockNo === -1) {
15
- currentFixedBlockNo = fixedBlockNo++;
16
- }
17
- return {
18
- blockNo: currentFixedBlockNo,
19
- fixed: true,
20
- msg: msg.msg,
21
- };
22
- }
23
- if (currentBlockNo === -1) {
24
- currentBlockNo = blockNo++;
25
- }
26
- return {
27
- blockNo: currentBlockNo,
28
- fixed: false,
29
- msg: typeof msg === 'string' ? msg : msg.msg, // eslint-disable-line
30
- prevFixedBlockNo: currentFixedBlockNo,
31
- };
32
- }));
33
- }), mergeAll(), scan((acc, log) => {
34
- if (log.fixed) {
35
- acc.fixedBlocks[log.blockNo] = log.msg;
36
- }
37
- else {
38
- delete acc.fixedBlocks[log.prevFixedBlockNo];
39
- acc.blocks[log.blockNo] = log.msg;
40
- }
41
- return acc;
42
- }, { fixedBlocks: [], blocks: [] }), map((sections) => {
43
- const fixedBlocks = sections.fixedBlocks.filter(Boolean);
44
- const nonFixedPart = sections.blocks.filter(Boolean).join(EOL);
45
- if (fixedBlocks.length === 0) {
46
- return nonFixedPart;
47
- }
48
- const fixedPart = fixedBlocks.join(EOL);
49
- if (!nonFixedPart) {
50
- return fixedPart;
51
- }
52
- return `${nonFixedPart}${EOL}${fixedPart}`;
53
- }), filter((msg) => {
54
- if (started) {
55
- return true;
56
- }
57
- if (msg === '')
58
- return false;
59
- started = true;
60
- return true;
61
- }), filter((msg) => {
62
- if (msg !== previousOutput) {
63
- previousOutput = msg;
64
- return true;
65
- }
66
- return false;
67
- }));
68
- }
69
- //# sourceMappingURL=mergeOutputs.js.map
@@ -1,3 +0,0 @@
1
- import type { Config } from '@pnpm/config.reader';
2
- import type { Log } from '@pnpm/core-loggers';
3
- export declare function reportError(logObj: Log, config?: Config): string | null;