@pnpm/cli.default-reporter 1100.2.6 → 1100.3.0

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.
@@ -11,6 +11,11 @@ export function reportLockfileVerification(lockfileVerification$, opts) {
11
11
  // both lines are printed.
12
12
  return Rx.of(lockfileVerification$.pipe(map((log) => {
13
13
  const path_ = formatLockfilePath(log.lockfilePath, opts.cwd, expectedDir);
14
+ if (log.status === 'cached') {
15
+ return {
16
+ msg: `${chalk.green('✓')} Lockfile${path_} passes supply-chain policies (${formatCachedVerdict(log.verifiedAt)})`,
17
+ };
18
+ }
14
19
  const entries = `${log.entries} ${log.entries === 1 ? 'entry' : 'entries'}`;
15
20
  switch (log.status) {
16
21
  case 'started':
@@ -31,6 +36,18 @@ export function reportLockfileVerification(lockfileVerification$, opts) {
31
36
  }
32
37
  })));
33
38
  }
39
+ // Relative "verified 2h ago" when the cached record carries a parseable
40
+ // timestamp; the timeless "previously verified" otherwise. The elapsed
41
+ // time is clamped at zero so a clock that moved backwards between the
42
+ // verification run and this install doesn't render a negative age.
43
+ function formatCachedVerdict(verifiedAt) {
44
+ if (verifiedAt == null)
45
+ return 'previously verified';
46
+ const elapsedMs = Date.now() - Date.parse(verifiedAt);
47
+ if (Number.isNaN(elapsedMs))
48
+ return 'previously verified';
49
+ return `verified ${prettyMs(Math.max(elapsedMs, 0), { compact: true })} ago`;
50
+ }
34
51
  // Returns a leading-space-prefixed `at <path>` suffix only when the
35
52
  // lockfile sits outside the obvious project/workspace root — otherwise
36
53
  // the path is implied and printing it would just add noise to every
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/cli.default-reporter",
3
- "version": "1100.2.6",
3
+ "version": "1100.3.0",
4
4
  "description": "The default reporter of pnpm",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -46,13 +46,13 @@
46
46
  "stacktracey": "^2.2.0",
47
47
  "string-length": "^7.0.1",
48
48
  "@pnpm/cli.meta": "1100.0.7",
49
- "@pnpm/config.reader": "1101.7.0",
50
- "@pnpm/core-loggers": "1100.1.4",
49
+ "@pnpm/core-loggers": "1100.2.0",
51
50
  "@pnpm/deps.inspection.peers-issues-renderer": "1100.0.5",
52
51
  "@pnpm/error": "1100.0.0",
53
52
  "@pnpm/installing.dedupe.issues-renderer": "1100.0.1",
54
53
  "@pnpm/installing.dedupe.types": "1100.0.1",
55
- "@pnpm/types": "1101.3.1"
54
+ "@pnpm/types": "1101.3.1",
55
+ "@pnpm/config.reader": "1101.8.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@pnpm/logger": "^1001.0.1"
@@ -65,7 +65,7 @@
65
65
  "ghooks": "2.0.4",
66
66
  "load-json-file": "^7.0.1",
67
67
  "normalize-newline": "5.0.0",
68
- "@pnpm/cli.default-reporter": "1100.2.6",
68
+ "@pnpm/cli.default-reporter": "1100.3.0",
69
69
  "@pnpm/logger": "1100.0.0"
70
70
  },
71
71
  "engines": {