cc-dev-template 0.1.29 → 0.1.31
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
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
const fs = require('fs');
|
|
11
11
|
const path = require('path');
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
// js-yaml is loaded lazily in collectADRs() to handle missing dependency gracefully
|
|
13
14
|
|
|
14
15
|
// Read hook input from stdin
|
|
15
16
|
let input = '';
|
|
@@ -22,7 +23,12 @@ process.stdin.on('end', () => {
|
|
|
22
23
|
console.log(JSON.stringify(result));
|
|
23
24
|
} catch (err) {
|
|
24
25
|
// On error, allow the tool call to proceed unchanged
|
|
25
|
-
console.log(JSON.stringify({
|
|
26
|
+
console.log(JSON.stringify({
|
|
27
|
+
hookSpecificOutput: {
|
|
28
|
+
hookEventName: "PreToolUse",
|
|
29
|
+
permissionDecision: "allow"
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
26
32
|
}
|
|
27
33
|
});
|
|
28
34
|
|
|
@@ -44,8 +50,11 @@ function processHook(hookInput) {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
return {
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
hookSpecificOutput: {
|
|
54
|
+
hookEventName: "PreToolUse",
|
|
55
|
+
permissionDecision: "allow",
|
|
56
|
+
updatedInput
|
|
57
|
+
}
|
|
49
58
|
};
|
|
50
59
|
}
|
|
51
60
|
|
|
@@ -53,6 +62,15 @@ function collectADRs() {
|
|
|
53
62
|
const adrDir = path.join(process.cwd(), '.claude', 'adrs');
|
|
54
63
|
const adrs = [];
|
|
55
64
|
|
|
65
|
+
// Try to load js-yaml - if unavailable, skip ADR collection entirely
|
|
66
|
+
let yaml;
|
|
67
|
+
try {
|
|
68
|
+
yaml = require('js-yaml');
|
|
69
|
+
} catch (err) {
|
|
70
|
+
// js-yaml not available - return empty array (ADR injection is best-effort)
|
|
71
|
+
return adrs;
|
|
72
|
+
}
|
|
73
|
+
|
|
56
74
|
if (!fs.existsSync(adrDir)) {
|
|
57
75
|
return adrs;
|
|
58
76
|
}
|