@cmodjs/cli 8.9.1 → 8.10.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/bin/cmod +5 -0
  2. package/package.json +3 -2
package/bin/cmod CHANGED
@@ -21,6 +21,7 @@ newer() {
21
21
  }
22
22
 
23
23
  store="${XDG_DATA_HOME:-$HOME/.local/share}/cmod/bin/cmod"
24
+ installed=
24
25
  package=$(CDPATH='' cd -- "$(dirname -- "$(readlink -f -- "$0")")/.." && pwd)
25
26
 
26
27
  if [ -f "$package/package.json" ]; then
@@ -57,6 +58,7 @@ if [ -f "$package/package.json" ]; then
57
58
  [ "$reported" = "$version" ] || fail "$release/$build reports version $reported, not $version"
58
59
  mv -f "$partial" "$folder/cmod"
59
60
  rm -f "$sums"
61
+ installed=$version
60
62
  trap - EXIT HUP INT TERM
61
63
  for older in "$store"/*/; do
62
64
  name=${older%/}
@@ -76,4 +78,7 @@ for folder in "$store"/*/; do
76
78
  if [ -z "$newest" ] || newer "$name" "$newest"; then newest=$name; fi
77
79
  done
78
80
  [ -n "$newest" ] || fail "no cmod is installed in $store. Run npm i -g @cmodjs/cli, or install the cmod plugin in Claude Code."
81
+ if [ -n "$installed" ]; then
82
+ CMOD_INSTALLED_VERSION=$installed exec "$store/$newest/cmod" "$@"
83
+ fi
79
84
  exec "$store/$newest/cmod" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmodjs/cli",
3
- "version": "8.9.1",
3
+ "version": "8.10.0",
4
4
  "description": "Claude Mod Manager: install, try, build, check, and publish Claude Code mods.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,7 +21,8 @@
21
21
  "scripts": {
22
22
  "build": "trap 'rm -f .*.bun-build' EXIT; for machine in ${CMOD_MACHINES:-darwin-arm64 darwin-x64 linux-arm64 linux-x64}; do bun build --compile --bytecode --format=esm --minify --no-compile-autoload-dotenv --no-compile-autoload-bunfig --target=bun-$machine src/main.ts src/history-worker.ts --outfile dist/cmod-$machine || exit 1; done",
23
23
  "check": "tsc --noEmit && OXLINT_TSGOLINT_PATH=../lint/node_modules/.bin/tsgolint ../lint/node_modules/.bin/oxlint --type-aware --deny-warnings",
24
- "test": "ls tests/*.test.ts | xargs -P 0 -n 1 bun test --timeout 30000"
24
+ "build:host": "CMOD_MACHINES=$(bun -p process.platform)-$(bun -p process.arch) bun run build",
25
+ "test": "sh -c 'bun run build:host > /dev/null && if [ $# -gt 0 ]; then printf \"%s\\n\" \"$@\"; else ls tests/*.test.ts; fi | xargs -P 0 -n 1 bun test' test"
25
26
  },
26
27
  "cmod": {
27
28
  "build": "bun run build",