@lzear/repo-lint 4.4.0 → 4.4.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/dist/bin.js CHANGED
@@ -22,6 +22,7 @@ import { maxSatisfying, satisfies } from "semver";
22
22
 
23
23
  // src/update.ts
24
24
  import { spawnSync } from "child_process";
25
+ import { createHash } from "crypto";
25
26
  import { existsSync, readFileSync, writeFileSync } from "fs";
26
27
  import path from "path";
27
28
  import { pathToFileURL } from "url";
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ import { maxSatisfying, satisfies } from "semver";
15
15
 
16
16
  // src/update.ts
17
17
  import { spawnSync } from "child_process";
18
+ import { createHash } from "crypto";
18
19
  import { existsSync, readFileSync, writeFileSync } from "fs";
19
20
  import path from "path";
20
21
  import { pathToFileURL } from "url";
@@ -297,7 +298,8 @@ var installCommands = (pm) => {
297
298
  ["yarn", "upgrade"]
298
299
  ] : [
299
300
  ["yarn", "install"],
300
- ["yarn", "up", "--recursive", "*"],
301
+ // '*' alone skips scoped packages (@foo/bar) — needs '@*/*' too
302
+ ["yarn", "up", "--recursive", "*", "@*/*"],
301
303
  ["yarn", "dedupe"]
302
304
  ];
303
305
  case "npm":
@@ -308,11 +310,13 @@ var installCommands = (pm) => {
308
310
  ];
309
311
  }
310
312
  };
313
+ var lockfileHash = (dir) => LOCKFILES.map(([f]) => path.join(dir, f)).filter((f) => existsSync(f)).map((f) => createHash("sha256").update(readFileSync(f)).digest("hex")).join("|");
311
314
  var stepInstall = (dir, pm) => {
312
315
  const base = {
313
316
  id: "install",
314
317
  desc: `install & refresh lockfile (${pm.name})`
315
318
  };
319
+ const before = lockfileHash(dir);
316
320
  const lines = [];
317
321
  for (const [command, ...arguments_] of installCommands(pm)) {
318
322
  lines.push(`$ ${[command, ...arguments_].join(" ")}`);
@@ -324,12 +328,18 @@ var stepInstall = (dir, pm) => {
324
328
  return {
325
329
  ...base,
326
330
  pass: false,
327
- changed: true,
331
+ changed: lockfileHash(dir) !== before,
328
332
  detail: `${lines.join("\n")}
329
333
  exited with ${result.status ?? "signal"}`
330
334
  };
331
335
  }
332
- return { ...base, pass: true, changed: true, detail: lines.join("\n") };
336
+ const changed = lockfileHash(dir) !== before;
337
+ return {
338
+ ...base,
339
+ pass: true,
340
+ changed,
341
+ detail: changed ? lines.join("\n") : "lockfile unchanged"
342
+ };
333
343
  };
334
344
  var runUpdate = async (options = {}) => {
335
345
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzear/repo-lint",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Checks lzear repos against forge standards",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -51,7 +51,7 @@
51
51
  "sherif": "^1"
52
52
  },
53
53
  "devDependencies": {
54
- "@lzear/configs": "4.4.0",
54
+ "@lzear/configs": "4.4.1",
55
55
  "@types/node": "^26",
56
56
  "@types/semver": "^7",
57
57
  "@vitest/coverage-v8": "^4",