architecture-harness 0.29.4 → 0.29.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": "architecture-harness",
3
- "version": "0.29.4",
3
+ "version": "0.29.5",
4
4
  "type": "module",
5
5
  "description": "Architecture gates, lint rules and scaffolding for the bounded-vertical-slice architecture",
6
6
  "license": "MIT",
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { spawnSync } from "node:child_process";
6
6
  import { createRequire } from "node:module";
7
- import { existsSync, readFileSync } from "node:fs";
7
+ import { existsSync, readFileSync, statSync } from "node:fs";
8
8
  import path from "node:path";
9
9
  import { pathToFileURL } from "node:url";
10
10
  import { gitOut, gitStatusWithin } from "./git-read.mjs";
@@ -15,7 +15,7 @@ const CONFIG_NAMES = ["eslint.config.js", "eslint.config.mjs", "eslint.config.cj
15
15
  /** True when a flat config sits in the folder of `file` or in any folder above it. */
16
16
  function configAbove(file) {
17
17
  for (let dir = path.dirname(file); ; dir = path.dirname(dir)) {
18
- if (CONFIG_NAMES.some((name) => existsSync(path.join(dir, name)))) return true;
18
+ if (CONFIG_NAMES.some((name) => statSync(path.join(dir, name), { throwIfNoEntry: false })?.isFile())) return true;
19
19
  if (path.dirname(dir) === dir) return false;
20
20
  }
21
21
  }
@@ -116,6 +116,16 @@ test("a file with no ESLint config is skipped, and the lint passes", (t) => {
116
116
  assert.doesNotMatch(nested.stdout, /lint skipped/);
117
117
  });
118
118
 
119
+ test("a directory named eslint.config.mjs above a changed file is skipped", (t) => {
120
+ const { root, qc } = repo(t);
121
+ rmSync(path.join(root, "eslint.config.mjs"));
122
+ mkdirSync(path.join(root, "eslint.config.mjs"));
123
+ writeFileSync(path.join(root, "src", "new.mjs"), "var fresh = 1;\nexport { fresh };\n");
124
+ const result = qc();
125
+ assert.equal(result.status, 0, result.stderr);
126
+ assert.match(result.stdout, /lint skipped 1 file\(s\) with no ESLint config/);
127
+ });
128
+
119
129
  test("qc lint applies the baseline per file and rule up to the recorded count", (t) => {
120
130
  const { root, qc } = repo(t);
121
131
  writeFileSync(path.join(root, "eslint-suppressions.json"), JSON.stringify({ "src/old.mjs": { "no-var": { count: 1 } } }));
package/src/cli/tools.mjs CHANGED
@@ -6,7 +6,7 @@ import path from "node:path";
6
6
  const TOOLS = {
7
7
  stack: { repo: "shawrylk/qc-stack", sha: "e34c270d92e3995b2e512f6eb690ea3cb0bc4699", bin: "qc-stack" },
8
8
  screens: { repo: "shawrylk/qc-screens", sha: "886c303508f4406f397b2221b470115c3cb89589", bin: "qc-screens" },
9
- "throwaway-db": { repo: "shawrylk/qc-throwaway-db", sha: "042fb52425d92ad5f656aa2c18884350ebe4dc08", bin: "qc-throwaway-db" },
9
+ "throwaway-db": { repo: "shawrylk/qc-throwaway-db", sha: "44c1a1189de893d1dbd181bbc2bea95cc6898dd3", bin: "qc-throwaway-db" },
10
10
  };
11
11
 
12
12
  /** Runs a pinned tool without passing its arguments through a shell. */
@@ -58,7 +58,7 @@ test("throwaway-db falls back to shell-free npx on POSIX and keeps the command s
58
58
  const argv = ["--port", "auto", "--", "node", "script with spaces.mjs", "a&b"];
59
59
  await runTool("throwaway-db", argv, options);
60
60
  assert.deepEqual(calls, [["npx", ["--yes", "-p",
61
- "github:shawrylk/qc-throwaway-db#042fb52425d92ad5f656aa2c18884350ebe4dc08", "qc-throwaway-db", ...argv,
61
+ "github:shawrylk/qc-throwaway-db#44c1a1189de893d1dbd181bbc2bea95cc6898dd3", "qc-throwaway-db", ...argv,
62
62
  ], { stdio: "inherit", env: { PATH: "/bin", CUSTOM: "kept", npm_config_allow_git: "all" } }]]);
63
63
  });
64
64