soloship 0.2.0 → 0.3.0

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.
Files changed (2) hide show
  1. package/dist/hooks.js +36 -8
  2. package/package.json +1 -1
package/dist/hooks.js CHANGED
@@ -296,18 +296,35 @@ fi
296
296
  '`;
297
297
  }
298
298
  function buildUpgradeCheckScript() {
299
- // Once-per-day check for newer Soloship npm releases. Silent if up-to-date,
300
- // network unavailable, or no version stamp exists. Cached to avoid hammering
301
- // the npm registry on every session start.
299
+ // Once-per-day check for newer Soloship releases. Detects whether the user
300
+ // installed via npm (.soloship/version present) or via Claude Code plugin
301
+ // marketplace only (plugin.json present, no .soloship/version) and shows
302
+ // the appropriate upgrade command for each. Silent if up-to-date, network
303
+ // unavailable, or installed version cannot be determined.
302
304
  return `bash -c '
303
305
  SOLOSHIP_DIR=".soloship"
304
306
  VERSION_FILE="$SOLOSHIP_DIR/version"
305
307
  CACHE_FILE="$SOLOSHIP_DIR/.last-update-check"
308
+ PLUGIN_MANIFEST="$HOME/.claude/plugins/marketplaces/soloship/.claude-plugin/plugin.json"
309
+
310
+ # Determine installed version + install path
311
+ INSTALLED=""
312
+ INSTALL_PATH=""
313
+ if [ -f "$VERSION_FILE" ]; then
314
+ INSTALLED=$(cat "$VERSION_FILE" 2>/dev/null | head -n1 | tr -d "[:space:]")
315
+ INSTALL_PATH="npm"
316
+ elif [ -f "$PLUGIN_MANIFEST" ]; then
317
+ INSTALLED=$(grep -E "\\"version\\"" "$PLUGIN_MANIFEST" 2>/dev/null | head -n1 | sed -E "s/.*\\"version\\"[[:space:]]*:[[:space:]]*\\"([^\\"]+)\\".*/\\\\1/" | tr -d "[:space:]")
318
+ INSTALL_PATH="plugin"
319
+ fi
306
320
 
307
- [ -f "$VERSION_FILE" ] || exit 0
308
- INSTALLED=$(cat "$VERSION_FILE" 2>/dev/null | head -n1 | tr -d "[:space:]")
309
321
  [ -z "$INSTALLED" ] && exit 0
310
322
 
323
+ # Cache (npm-path projects keep cache in .soloship/; plugin-path falls back to /tmp)
324
+ if [ "$INSTALL_PATH" = "plugin" ]; then
325
+ CACHE_FILE="/tmp/.soloship-update-check-$(id -u)"
326
+ fi
327
+
311
328
  NOW=$(date +%s)
312
329
  LATEST=""
313
330
  if [ -f "$CACHE_FILE" ]; then
@@ -319,16 +336,27 @@ if [ -f "$CACHE_FILE" ]; then
319
336
  fi
320
337
 
321
338
  if [ -z "$LATEST" ]; then
322
- LATEST=$(timeout 3 npm view soloship version 2>/dev/null | tr -d "[:space:]")
339
+ # Prefer npm for the source-of-truth version (npm + plugin ship from same repo).
340
+ # If npm isn't available, fall back to the GitHub raw plugin.json on main.
341
+ if command -v npm >/dev/null 2>&1; then
342
+ LATEST=$(timeout 3 npm view soloship version 2>/dev/null | tr -d "[:space:]")
343
+ fi
344
+ if [ -z "$LATEST" ] && command -v curl >/dev/null 2>&1; then
345
+ LATEST=$(timeout 3 curl -sf "https://raw.githubusercontent.com/thedigitalorganizer/soloship/main/.claude-plugin/plugin.json" 2>/dev/null | grep -E "\\"version\\"" | head -n1 | sed -E "s/.*\\"version\\"[[:space:]]*:[[:space:]]*\\"([^\\"]+)\\".*/\\\\1/" | tr -d "[:space:]")
346
+ fi
323
347
  [ -z "$LATEST" ] && exit 0
324
- mkdir -p "$SOLOSHIP_DIR"
348
+ mkdir -p "$(dirname "$CACHE_FILE")" 2>/dev/null
325
349
  printf "%s\\n%s\\n" "$NOW" "$LATEST" > "$CACHE_FILE" 2>/dev/null
326
350
  fi
327
351
 
328
352
  if [ "$INSTALLED" != "$LATEST" ]; then
329
353
  NEWEST=$(printf "%s\\n%s\\n" "$INSTALLED" "$LATEST" | sort -V | tail -n1)
330
354
  if [ "$NEWEST" = "$LATEST" ]; then
331
- echo "{\\"systemMessage\\": \\"Soloship update available: $INSTALLED $LATEST. Run: npx soloship upgrade\\"}"
355
+ if [ "$INSTALL_PATH" = "plugin" ]; then
356
+ echo "{\\"systemMessage\\": \\"Soloship update available: $INSTALLED → $LATEST. Update via Claude Code: type /plugins, find Soloship, click Update.\\"}"
357
+ else
358
+ echo "{\\"systemMessage\\": \\"Soloship update available: $INSTALLED → $LATEST. Run: npx soloship upgrade\\"}"
359
+ fi
332
360
  fi
333
361
  fi
334
362
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soloship",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Systematic programming methodology for AI-assisted development",
5
5
  "type": "module",
6
6
  "bin": {