hookstack-cli 0.1.38 → 0.1.40
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/bin/cli +8 -0
- package/bin/core.mjs +14 -0
- package/package.json +1 -1
package/bin/cli
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
assertSafeTarget,
|
|
14
14
|
collectIncomingHooks,
|
|
15
15
|
buildSecurityRows,
|
|
16
|
+
buildPostInstallHints,
|
|
16
17
|
doInstallTests,
|
|
17
18
|
} from './core.mjs'
|
|
18
19
|
|
|
@@ -234,6 +235,7 @@ async function interactiveInstall(slugs, args) {
|
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
// Result panel
|
|
238
|
+
const hints = buildPostInstallHints(hooks)
|
|
237
239
|
const resultLines = [
|
|
238
240
|
pc.green(`✓ ${dirs.settingsPath}`),
|
|
239
241
|
result.scriptCount > 0
|
|
@@ -242,6 +244,8 @@ async function interactiveInstall(slugs, args) {
|
|
|
242
244
|
testResult?.testCount > 0
|
|
243
245
|
? pc.green(`✓ ${testResult.testCount} test file${testResult.testCount === 1 ? '' : 's'} written to tests/hooks/`)
|
|
244
246
|
: null,
|
|
247
|
+
hints.length > 0 ? '' : null,
|
|
248
|
+
...hints.map(h => pc.yellow(`⚠ ${h.slug}: ${h.hint}`)),
|
|
245
249
|
'',
|
|
246
250
|
`Browse more hooks ${pc.cyan(`${API_BASE}/#catalogue`)}`,
|
|
247
251
|
`⭐ Star us ${pc.cyan(REPO_URL)}`,
|
|
@@ -281,6 +285,10 @@ async function directInstall(slugs, args) {
|
|
|
281
285
|
console.warn(` ! Could not write tests: ${e.message}`)
|
|
282
286
|
}
|
|
283
287
|
}
|
|
288
|
+
const hints = buildPostInstallHints(hooks)
|
|
289
|
+
if (hints.length > 0) {
|
|
290
|
+
for (const h of hints) console.warn(` ⚠ ${h.slug}: ${h.hint}`)
|
|
291
|
+
}
|
|
284
292
|
console.log(`\n✅ ${plural(result.hookCount, 'hook')} installed · star us → ${REPO_URL}`)
|
|
285
293
|
console.log(' Restart Claude Code to activate.\n')
|
|
286
294
|
}
|
package/bin/core.mjs
CHANGED
|
@@ -211,6 +211,20 @@ export function buildSummaryRows(hooks, { root }) {
|
|
|
211
211
|
})
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
// Maps hook slugs to post-install hints about required external tools.
|
|
215
|
+
// Keep as a plain object so it's trivially testable without any async/fetch.
|
|
216
|
+
export const PREREQ_HINTS = {
|
|
217
|
+
'stop-duplication-check': 'Requires jscpd: pnpm add -D jscpd (or npm install -g jscpd)',
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Returns one hint entry per installed hook that has an external prerequisite.
|
|
221
|
+
export function buildPostInstallHints(hooks) {
|
|
222
|
+
return hooks.flatMap(h => {
|
|
223
|
+
const hint = PREREQ_HINTS[h.slug]
|
|
224
|
+
return hint ? [{ slug: h.slug, hint }] : []
|
|
225
|
+
})
|
|
226
|
+
}
|
|
227
|
+
|
|
214
228
|
// Display rows for the "Installation Summary" panel: description + static capabilities + verdicts.
|
|
215
229
|
export function buildSecurityRows(hooks) {
|
|
216
230
|
return hooks.map(h => ({
|