@lzear/repo-lint 4.3.0 → 4.4.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.
package/README.md CHANGED
@@ -83,7 +83,7 @@ const report = await runUpdate({ dry: true })
83
83
  | `readme-npm-badge` | README has an npm badge |
84
84
  | `codacy` | Codacy grade & coverage badges in README, `.codacy.yml` |
85
85
  | `license` | `LICENSE` exists |
86
- | `ci-workflow` | `.github/workflows/ci.yml` exists |
86
+ | `ci-workflow` | a workflow calls the forge reusable CI workflow |
87
87
  | `renovate` | `renovate.json` exists |
88
88
  | `pkg-publint` | All published packages pass `publint` |
89
89
  | `pkg-attw` | All published packages pass `attw` (ESM-only profile) |
package/dist/bin.js CHANGED
@@ -129,6 +129,17 @@ var readmeIncludes = (dir, needle) => {
129
129
  const f = path2.join(dir, "README.md");
130
130
  return existsSync2(f) && readFileSync2(f, "utf8").includes(needle);
131
131
  };
132
+ var FORGE_WORKFLOW_RE = /uses:\s*lzear\/forge\/\.github\/workflows\/ci\.yml@/;
133
+ var isForgeRepo = (dir) => getWorkspaceDirectories(dir).some(
134
+ (d) => readPackage(d)?.name === "@lzear/forge"
135
+ );
136
+ var callsForgeWorkflow = (dir) => {
137
+ const wfDir = path2.join(dir, ".github", "workflows");
138
+ if (!existsSync2(wfDir)) return false;
139
+ return readdirSync(wfDir).filter((f) => /\.ya?ml$/.test(f)).some(
140
+ (f) => FORGE_WORKFLOW_RE.test(readFileSync2(path2.join(wfDir, f), "utf8"))
141
+ );
142
+ };
132
143
  var auditCommand = (pm) => {
133
144
  switch (pm.name) {
134
145
  case "npm":
@@ -232,10 +243,16 @@ var LOCAL_CHECKS = [
232
243
  },
233
244
  {
234
245
  id: "ci-workflow",
235
- desc: "CI workflow",
246
+ desc: "CI calls forge workflow",
236
247
  type: "local",
237
248
  publishedOnly: true,
238
- check: (dir) => existsSync2(path2.join(dir, ".github/workflows/ci.yml"))
249
+ check: (dir) => {
250
+ if (callsForgeWorkflow(dir) || isForgeRepo(dir)) return true;
251
+ return {
252
+ pass: false,
253
+ detail: "no workflow calls the forge reusable CI \u2014 replace the local ci.yml copy with:\n jobs:\n ci:\n uses: lzear/forge/.github/workflows/ci.yml@<sha> # vX.Y.Z\n(pin to a commit SHA; renovate keeps it fresh)"
254
+ };
255
+ }
239
256
  },
240
257
  {
241
258
  id: "renovate",
package/dist/index.js CHANGED
@@ -423,6 +423,17 @@ var readmeIncludes = (dir, needle) => {
423
423
  const f = path2.join(dir, "README.md");
424
424
  return existsSync2(f) && readFileSync2(f, "utf8").includes(needle);
425
425
  };
426
+ var FORGE_WORKFLOW_RE = /uses:\s*lzear\/forge\/\.github\/workflows\/ci\.yml@/;
427
+ var isForgeRepo = (dir) => getWorkspaceDirectories(dir).some(
428
+ (d) => readPackage(d)?.name === "@lzear/forge"
429
+ );
430
+ var callsForgeWorkflow = (dir) => {
431
+ const wfDir = path2.join(dir, ".github", "workflows");
432
+ if (!existsSync2(wfDir)) return false;
433
+ return readdirSync(wfDir).filter((f) => /\.ya?ml$/.test(f)).some(
434
+ (f) => FORGE_WORKFLOW_RE.test(readFileSync2(path2.join(wfDir, f), "utf8"))
435
+ );
436
+ };
426
437
  var auditCommand = (pm) => {
427
438
  switch (pm.name) {
428
439
  case "npm":
@@ -526,10 +537,16 @@ var LOCAL_CHECKS = [
526
537
  },
527
538
  {
528
539
  id: "ci-workflow",
529
- desc: "CI workflow",
540
+ desc: "CI calls forge workflow",
530
541
  type: "local",
531
542
  publishedOnly: true,
532
- check: (dir) => existsSync2(path2.join(dir, ".github/workflows/ci.yml"))
543
+ check: (dir) => {
544
+ if (callsForgeWorkflow(dir) || isForgeRepo(dir)) return true;
545
+ return {
546
+ pass: false,
547
+ detail: "no workflow calls the forge reusable CI \u2014 replace the local ci.yml copy with:\n jobs:\n ci:\n uses: lzear/forge/.github/workflows/ci.yml@<sha> # vX.Y.Z\n(pin to a commit SHA; renovate keeps it fresh)"
548
+ };
549
+ }
533
550
  },
534
551
  {
535
552
  id: "renovate",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lzear/repo-lint",
3
- "version": "4.3.0",
3
+ "version": "4.4.0",
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.3.0",
54
+ "@lzear/configs": "4.4.0",
55
55
  "@types/node": "^26",
56
56
  "@types/semver": "^7",
57
57
  "@vitest/coverage-v8": "^4",