@afokapu/atdd-bun 0.10.11 → 0.10.13
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.
|
@@ -51,7 +51,7 @@ function planFiles(dir, excludes) {
|
|
|
51
51
|
function declaredUrns(croot, excludes, planRoot) {
|
|
52
52
|
const urns = new Set();
|
|
53
53
|
for (const f of planFiles(join(croot, planRoot), excludes)) {
|
|
54
|
-
for (const m of read(f).matchAll(/\b((?:acc|wmbt):[a-z0-9][\w.-]*(?::[\w.-]+)
|
|
54
|
+
for (const m of read(f).matchAll(/\b((?:acc|wmbt):[a-z0-9][\w.-]*(?::[\w.-]+)*)/gi)) {
|
|
55
55
|
urns.add(m[1]);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -24,10 +24,19 @@
|
|
|
24
24
|
// acceptances, so a one-acceptance-per-file naming rule would fragment a real
|
|
25
25
|
// suite. Both levels are parsed here.
|
|
26
26
|
import { readFileSync, statSync, readdirSync, writeFileSync } from "node:fs";
|
|
27
|
-
import { join, extname, sep } from "node:path";
|
|
27
|
+
import { dirname, join, extname, sep } from "node:path";
|
|
28
|
+
import { fileURLToPath } from "node:url";
|
|
28
29
|
|
|
29
30
|
export const DEFAULT_EXCLUDES = ["node_modules", "dist", "build", ".next", ".git", "_generated"];
|
|
30
31
|
export const TEST_RE = /\.(test|spec)\.[cm]?[jt]sx?$/;
|
|
32
|
+
|
|
33
|
+
// atdd-bun generates atdd-bun.integrity.test.ts and forbids editing it, so no tester rule judges it. It is recognised by
|
|
34
|
+
// its content, the package's template with the version filled in, never by name or header: a copy of either earns nothing.
|
|
35
|
+
const INTEGRITY_TEMPLATE = (() => { try { return readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../../templates/agents/atdd-bun.integrity.test.ts"), "utf8"); } catch { return null; } })();
|
|
36
|
+
function isGeneratedIntegrityTest(path) {
|
|
37
|
+
if (!INTEGRITY_TEMPLATE || !path.endsWith("atdd-bun.integrity.test.ts")) return false;
|
|
38
|
+
try { return readFileSync(path, "utf8").replace(/^(\/\/ Generated by @afokapu\/atdd-bun )\S+?(\. Do not edit)/, "$1{{VERSION}}$2") === INTEGRITY_TEMPLATE; } catch { return false; }
|
|
39
|
+
}
|
|
31
40
|
export const PHASES = new Set(["RED", "UNIT", "SMOKE", "E2E"]);
|
|
32
41
|
export const LAYERS = new Set(["domain", "application", "integration", "presentation", "assembly"]);
|
|
33
42
|
|
|
@@ -50,7 +59,7 @@ function isExcluded(path, excludes) {
|
|
|
50
59
|
export function* walkTests(root, excludes) {
|
|
51
60
|
let st;
|
|
52
61
|
try { st = statSync(root); } catch { return; }
|
|
53
|
-
if (st.isFile()) { if (TEST_RE.test(root)) yield root; return; }
|
|
62
|
+
if (st.isFile()) { if (TEST_RE.test(root) && !isGeneratedIntegrityTest(root)) yield root; return; }
|
|
54
63
|
let names;
|
|
55
64
|
try { names = readdirSync(root); } catch { return; }
|
|
56
65
|
for (const name of names) {
|
|
@@ -59,7 +68,7 @@ export function* walkTests(root, excludes) {
|
|
|
59
68
|
let cst;
|
|
60
69
|
try { cst = statSync(full); } catch { continue; }
|
|
61
70
|
if (cst.isDirectory()) yield* walkTests(full, excludes);
|
|
62
|
-
else if (TEST_RE.test(full)) yield full;
|
|
71
|
+
else if (TEST_RE.test(full) && !isGeneratedIntegrityTest(full)) yield full;
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
74
|
|
package/integrity.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.10.
|
|
2
|
+
"version": "0.10.13",
|
|
3
3
|
"files": {
|
|
4
4
|
"HOOK_AUDIT.md": "5329d840db37671b1918f688ead26865473b87db73dbc75f7c8b2a8bbe8d6d43",
|
|
5
5
|
"PLANNER_PORT.md": "fb5935bac8b7ac18994de21e43ace3a5ef8cd55f85b0e3349fca261280054f11",
|
|
@@ -585,7 +585,7 @@
|
|
|
585
585
|
"detectors/bun_tester_discipline_detector/checks/_map.json": "d28273b975c4fbcda64026178b918dc9a84315d6312f29ae5221a0a9cb4c0b44",
|
|
586
586
|
"detectors/bun_tester_discipline_detector/checks/t_acceptance_binding.mjs": "17861380275433ff79e191803456417454e2efa23801d9ac72bf6f8206337522",
|
|
587
587
|
"detectors/bun_tester_discipline_detector/checks/t_acceptance_covers_tag.mjs": "2116c9936cb5863df643b968dece23c29e145ede30cf7c7862e5c17ac7beb6dd",
|
|
588
|
-
"detectors/bun_tester_discipline_detector/checks/t_acceptance_resolves.mjs": "
|
|
588
|
+
"detectors/bun_tester_discipline_detector/checks/t_acceptance_resolves.mjs": "e4ee0759150f10ab93a50b7d50fcca7caec4df2a08b9ef56ebb33a19ee0e8c31",
|
|
589
589
|
"detectors/bun_tester_discipline_detector/checks/t_isolation_no_live_state.mjs": "de2c396b83bc2e5317f6b8eee31c98103e7360d1cd25e7c1c53db6ff7627203f",
|
|
590
590
|
"detectors/bun_tester_discipline_detector/checks/t_red_behavioral.mjs": "ac0b77bbf10a08d991272fbce41db2a34187c8f5faf1e04c5b1a858ecfbcc4ef",
|
|
591
591
|
"detectors/bun_tester_discipline_detector/checks/t_red_fails_first.mjs": "06cb66f5ccf7d59e1d21f6d3a9db29ca7f3182c096b17ddb50b85b319b97208b",
|
|
@@ -641,7 +641,7 @@
|
|
|
641
641
|
"detectors/bun_tester_discipline_detector/fixtures/dirty/unresolvable_binding.test.ts": "fd878356127cd66c05a1ab2c461982366f3a757895decf19cf24634f2c476d44",
|
|
642
642
|
"detectors/bun_tester_discipline_detector/fixtures/dirty/vacuous.red.test.ts": "deea6befc7f87aa54b52df40f1032e4b547cb1336da3aec985c76aeb5097364a",
|
|
643
643
|
"detectors/bun_tester_discipline_detector/fixtures/dirty/wrongruntime.test.ts": "041e421ef2b2810545020b5945733822dcae416d3360657217d3bab901cc2cdd",
|
|
644
|
-
"detectors/bun_tester_discipline_detector/test_header.mjs": "
|
|
644
|
+
"detectors/bun_tester_discipline_detector/test_header.mjs": "f4b5934bb08cfc3b3c0b4fc33b4136662c6643f1cad9e47d270214b5b2b48cd4",
|
|
645
645
|
"detectors/bun_ts_metrics_detector/atdd.implementation.yaml": "6ced804a5fdc82b6cd52be21ebacefa5d3261fca03a391178b2bf21186776364",
|
|
646
646
|
"detectors/bun_ts_metrics_detector/checks/_map.json": "ed7c198564a80252f92e8ba2f50352daa1476ea88a23bfc0b3630e58c688f95d",
|
|
647
647
|
"detectors/bun_ts_metrics_detector/checks/ts_complexity_cyclomatic.mjs": "56640b3a0f565c45a73b7c174adb1d6b4b6ac24d286a907bc1426f013cd6039e",
|