prjct-cli 0.30.0 → 0.30.1

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/prjct CHANGED
@@ -5,7 +5,9 @@
5
5
  # Detects available runtime (bun preferred, node fallback)
6
6
  # and executes the appropriate entry point.
7
7
  #
8
- # @version 1.1.0
8
+ # CRITICAL: Also ensures p.md is installed (self-healing)
9
+ #
10
+ # @version 1.2.0
9
11
 
10
12
  # Resolve symlinks to get the actual script location
11
13
  resolve_symlink() {
@@ -41,6 +43,56 @@ SCRIPT_PATH="$(resolve_symlink "$0")"
41
43
  SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
42
44
  ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
43
45
 
46
+ # CRITICAL: Ensure p.md is installed (self-healing)
47
+ # This runs EVERY time prjct is called, ensuring setup even if postinstall failed
48
+ ensure_setup() {
49
+ CLAUDE_COMMANDS="$HOME/.claude/commands"
50
+ PMD_SRC="$ROOT_DIR/templates/commands/p.md"
51
+ PMD_DEST="$CLAUDE_COMMANDS/p.md"
52
+
53
+ # Create dir if needed
54
+ if [ ! -d "$CLAUDE_COMMANDS" ]; then
55
+ mkdir -p "$CLAUDE_COMMANDS" 2>/dev/null
56
+ fi
57
+
58
+ # Copy p.md if source exists and dest doesn't OR dest is older
59
+ if [ -f "$PMD_SRC" ]; then
60
+ if [ ! -f "$PMD_DEST" ]; then
61
+ cp "$PMD_SRC" "$PMD_DEST" 2>/dev/null
62
+ elif [ "$PMD_SRC" -nt "$PMD_DEST" ]; then
63
+ # Source is newer, update
64
+ cp "$PMD_SRC" "$PMD_DEST" 2>/dev/null
65
+ fi
66
+ fi
67
+
68
+ # Also ensure statusline (best effort)
69
+ STATUSLINE_SRC="$ROOT_DIR/assets/statusline/statusline.sh"
70
+ STATUSLINE_DIR="$HOME/.prjct-cli/statusline"
71
+ STATUSLINE_DEST="$STATUSLINE_DIR/statusline.sh"
72
+ CLAUDE_STATUSLINE="$HOME/.claude/prjct-statusline.sh"
73
+
74
+ if [ -f "$STATUSLINE_SRC" ]; then
75
+ mkdir -p "$STATUSLINE_DIR" 2>/dev/null
76
+ if [ ! -f "$STATUSLINE_DEST" ] || [ "$STATUSLINE_SRC" -nt "$STATUSLINE_DEST" ]; then
77
+ cp "$STATUSLINE_SRC" "$STATUSLINE_DEST" 2>/dev/null
78
+ chmod +x "$STATUSLINE_DEST" 2>/dev/null
79
+
80
+ # Copy lib, components, themes
81
+ for subdir in lib components themes; do
82
+ if [ -d "$ROOT_DIR/assets/statusline/$subdir" ]; then
83
+ mkdir -p "$STATUSLINE_DIR/$subdir" 2>/dev/null
84
+ cp "$ROOT_DIR/assets/statusline/$subdir"/* "$STATUSLINE_DIR/$subdir/" 2>/dev/null
85
+ fi
86
+ done
87
+
88
+ # Symlink to ~/.claude
89
+ rm -f "$CLAUDE_STATUSLINE" 2>/dev/null
90
+ ln -s "$STATUSLINE_DEST" "$CLAUDE_STATUSLINE" 2>/dev/null || cp "$STATUSLINE_DEST" "$CLAUDE_STATUSLINE" 2>/dev/null
91
+ chmod +x "$CLAUDE_STATUSLINE" 2>/dev/null
92
+ fi
93
+ fi
94
+ }
95
+
44
96
  # Check if bun is available
45
97
  check_bun() {
46
98
  command -v bun >/dev/null 2>&1
@@ -74,6 +126,9 @@ run_with_node() {
74
126
 
75
127
  # Main execution
76
128
  main() {
129
+ # ALWAYS ensure setup first (self-healing)
130
+ ensure_setup
131
+
77
132
  # Prefer bun if available (faster, native TS support)
78
133
  if check_bun; then
79
134
  run_with_bun "$@"
@@ -12541,7 +12541,7 @@ var require_package = __commonJS({
12541
12541
  "package.json"(exports, module) {
12542
12542
  module.exports = {
12543
12543
  name: "prjct-cli",
12544
- version: "0.29.10",
12544
+ version: "0.30.1",
12545
12545
  description: "Built for Claude - Ship fast, track progress, stay focused. Developer momentum tool for indie hackers.",
12546
12546
  main: "core/index.ts",
12547
12547
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prjct-cli",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "description": "Built for Claude - Ship fast, track progress, stay focused. Developer momentum tool for indie hackers.",
5
5
  "main": "core/index.ts",
6
6
  "bin": {