@zgeoff/chex 0.8.4 → 0.8.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/chex",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "Run each shared docs and repo check as one subcommand, with the lefthook pre-push baseline that calls them",
5
5
  "keywords": [
6
6
  "checks",
@@ -7,7 +7,11 @@ export function parseFixablePackages(output: string): string[] {
7
7
  throw new TypeError('bun audit fix --json printed no object');
8
8
  }
9
9
 
10
- const stuck = new Set([...collectNames(plan, 'blocked'), ...collectNames(plan, 'unfixable')]);
10
+ const stuck = new Set([
11
+ ...collectNames(plan, 'blocked'),
12
+ ...collectNames(plan, 'unfixable'),
13
+ ...collectYoungFixNames(plan),
14
+ ]);
11
15
 
12
16
  return [...new Set(collectNames(plan, 'fixes'))].filter((name) => !stuck.has(name));
13
17
  }
@@ -27,3 +31,21 @@ function collectNames(plan: Record<string, unknown>, key: string): string[] {
27
31
  return entry['name'];
28
32
  });
29
33
  }
34
+
35
+ // `bun install` refuses a release younger than `minimumReleaseAge`, so until the fix ages past the
36
+ // gate, an ignore is the only way to pass the audit without an exclude
37
+ function collectYoungFixNames(plan: Record<string, unknown>): string[] {
38
+ const list = plan['fixes'];
39
+
40
+ if (!Array.isArray(list)) {
41
+ return [];
42
+ }
43
+
44
+ return list.flatMap((entry: unknown) =>
45
+ isRecord(entry) &&
46
+ typeof entry['name'] === 'string' &&
47
+ entry['newerThanMinimumReleaseAge'] === true
48
+ ? [entry['name']]
49
+ : [],
50
+ );
51
+ }