@nusoft/nuos-build-catalogue 0.30.1 → 0.30.2
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": "@nusoft/nuos-build-catalogue",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.2",
|
|
4
4
|
"description": "NuOS build-catalogue tooling: semantic search (WU 110) + migration runner that lifts markdown artefacts into JSON-backed workflow records (WU 111, Phase G).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,6 +15,64 @@
|
|
|
15
15
|
|
|
16
16
|
set -euo pipefail
|
|
17
17
|
|
|
18
|
+
# ---- Ensure nuos-catalogue CLI is installed --------------------------------
|
|
19
|
+
#
|
|
20
|
+
# The CLI is a global npm tool with no presence in any package.json — it
|
|
21
|
+
# disappears silently when global packages are cleared. Install it here so
|
|
22
|
+
# the build memory system is always ready after a post-clone setup run.
|
|
23
|
+
|
|
24
|
+
if ! command -v nuos-catalogue &>/dev/null; then
|
|
25
|
+
echo "▶ nuos-catalogue not found — installing @nusoft/nuos-build-catalogue globally..."
|
|
26
|
+
npm install -g @nusoft/nuos-build-catalogue
|
|
27
|
+
echo "✓ nuos-catalogue installed"
|
|
28
|
+
else
|
|
29
|
+
echo "✓ nuos-catalogue present ($(nuos-catalogue --version 2>/dev/null | head -1 || echo 'version unknown'))"
|
|
30
|
+
fi
|
|
31
|
+
echo
|
|
32
|
+
|
|
33
|
+
# ---- Patch ~/.claude/settings.json with the Playwright singleton hook ------
|
|
34
|
+
#
|
|
35
|
+
# Each VS Code Claude Code window spawns its own playwright-mcp process. They
|
|
36
|
+
# all share one Chrome profile, and Chrome's singleton lock means only the first
|
|
37
|
+
# one to open Chrome succeeds — every later session gets "browser already in use".
|
|
38
|
+
# This PreToolUse hook kills the locked Chrome before each browser_navigate so
|
|
39
|
+
# the current session always gets a clean launch.
|
|
40
|
+
|
|
41
|
+
CLAUDE_SETTINGS="$HOME/.claude/settings.json"
|
|
42
|
+
PLAYWRIGHT_HOOK_MARKER="mcp__plugin_playwright_playwright__browser_navigate"
|
|
43
|
+
|
|
44
|
+
if [[ -f "$CLAUDE_SETTINGS" ]] && ! grep -q "$PLAYWRIGHT_HOOK_MARKER" "$CLAUDE_SETTINGS"; then
|
|
45
|
+
echo "▶ Patching ~/.claude/settings.json with Playwright singleton hook..."
|
|
46
|
+
node -e "
|
|
47
|
+
const fs = require('fs');
|
|
48
|
+
const path = '$CLAUDE_SETTINGS';
|
|
49
|
+
const settings = JSON.parse(fs.readFileSync(path, 'utf8'));
|
|
50
|
+
settings.hooks = settings.hooks || {};
|
|
51
|
+
settings.hooks.PreToolUse = settings.hooks.PreToolUse || [];
|
|
52
|
+
const alreadySet = settings.hooks.PreToolUse.some(h => h.matcher === '$PLAYWRIGHT_HOOK_MARKER');
|
|
53
|
+
if (!alreadySet) {
|
|
54
|
+
settings.hooks.PreToolUse.push({
|
|
55
|
+
matcher: '$PLAYWRIGHT_HOOK_MARKER',
|
|
56
|
+
hooks: [{
|
|
57
|
+
type: 'command',
|
|
58
|
+
command: \"pkill -f 'user-data-dir.*mcp-chrome' 2>/dev/null; sleep 0.5; exit 0\",
|
|
59
|
+
timeout: 5,
|
|
60
|
+
statusMessage: 'Clearing stale Playwright browser...'
|
|
61
|
+
}]
|
|
62
|
+
});
|
|
63
|
+
fs.writeFileSync(path, JSON.stringify(settings, null, 2) + '\n');
|
|
64
|
+
console.log('✓ Playwright singleton hook added');
|
|
65
|
+
} else {
|
|
66
|
+
console.log('✓ Playwright singleton hook already present');
|
|
67
|
+
}
|
|
68
|
+
"
|
|
69
|
+
elif [[ ! -f "$CLAUDE_SETTINGS" ]]; then
|
|
70
|
+
echo "⚠ ~/.claude/settings.json not found — skipping Playwright hook patch (Claude Code not installed?)"
|
|
71
|
+
else
|
|
72
|
+
echo "✓ Playwright singleton hook already present in ~/.claude/settings.json"
|
|
73
|
+
fi
|
|
74
|
+
echo
|
|
75
|
+
|
|
18
76
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
19
77
|
SOURCE="$REPO_ROOT/scripts/hooks"
|
|
20
78
|
TARGET="$REPO_ROOT/.git/hooks"
|