@dpeluche/trs 0.5.2 → 0.5.3

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 (3) hide show
  1. package/bin/trs +26 -8
  2. package/bin/trs.cmd +14 -5
  3. package/package.json +6 -6
package/bin/trs CHANGED
@@ -32,22 +32,40 @@ case "$ARCH" in
32
32
  *) echo "trs: unsupported arch: $ARCH" >&2; exit 1 ;;
33
33
  esac
34
34
 
35
- # Default path: sibling package in node_modules/@dpeluche/
36
- BIN="$DIR/../../trs-cli-$OS-$ARCH/trs"
35
+ PKG="@dpeluche/trs-cli-$OS-$ARCH"
36
+ BIN=""
37
37
 
38
- # Env override for custom builds / debugging
39
- if [ -n "${TRS_BINARY:-}" ]; then
38
+ # Env override takes priority (custom builds / debugging)
39
+ if [ -n "${TRS_BINARY:-}" ] && [ -x "$TRS_BINARY" ]; then
40
40
  BIN="$TRS_BINARY"
41
41
  fi
42
42
 
43
- if [ ! -x "$BIN" ]; then
44
- echo "trs: binary not found at $BIN" >&2
43
+ # Candidate locations npm may use for the optional dependency:
44
+ # - sibling: hoisted to parent node_modules (npm local install, npm >=7)
45
+ # - nested: inside our own node_modules (npm install -g, pnpm isolated)
46
+ # - parent: deduplicated one level up (workspaces)
47
+ if [ -z "$BIN" ]; then
48
+ for candidate in \
49
+ "$DIR/../../trs-cli-$OS-$ARCH/trs" \
50
+ "$DIR/../node_modules/$PKG/trs" \
51
+ "$DIR/../../../$PKG/trs" \
52
+ "$DIR/../../node_modules/$PKG/trs"; do
53
+ if [ -x "$candidate" ]; then
54
+ BIN="$candidate"
55
+ break
56
+ fi
57
+ done
58
+ fi
59
+
60
+ if [ -z "$BIN" ]; then
61
+ echo "trs: platform binary not found" >&2
45
62
  echo "" >&2
46
- echo "Expected platform package: @dpeluche/trs-cli-$OS-$ARCH" >&2
63
+ echo "Expected package: $PKG" >&2
64
+ echo "Searched near: $DIR" >&2
47
65
  echo "" >&2
48
66
  echo "Alternatives:" >&2
49
67
  echo " cargo install tars-cli # build from source" >&2
50
- echo " brew install trs # macOS (when available)" >&2
68
+ echo " curl -fsSL https://raw.githubusercontent.com/dPeluChe/trs/main/scripts/install.sh | sh" >&2
51
69
  exit 1
52
70
  fi
53
71
 
package/bin/trs.cmd CHANGED
@@ -4,14 +4,23 @@ rem See bin/trs for the Unix equivalent.
4
4
  setlocal
5
5
 
6
6
  set "DIR=%~dp0"
7
- set "BIN=%DIR%..\..\trs-cli-win32-x64\trs.exe"
7
+ set "PKG=trs-cli-win32-x64"
8
+ set "BIN="
8
9
 
9
- if defined TRS_BINARY set "BIN=%TRS_BINARY%"
10
+ if defined TRS_BINARY (
11
+ if exist "%TRS_BINARY%" set "BIN=%TRS_BINARY%"
12
+ )
13
+
14
+ rem Candidate locations npm may use for the optional dependency.
15
+ if not defined BIN if exist "%DIR%..\..\%PKG%\trs.exe" set "BIN=%DIR%..\..\%PKG%\trs.exe"
16
+ if not defined BIN if exist "%DIR%..\node_modules\@dpeluche\%PKG%\trs.exe" set "BIN=%DIR%..\node_modules\@dpeluche\%PKG%\trs.exe"
17
+ if not defined BIN if exist "%DIR%..\..\..\@dpeluche\%PKG%\trs.exe" set "BIN=%DIR%..\..\..\@dpeluche\%PKG%\trs.exe"
10
18
 
11
- if not exist "%BIN%" (
12
- echo trs: binary not found at %BIN% 1>&2
19
+ if not defined BIN (
20
+ echo trs: platform binary not found 1>&2
13
21
  echo. 1>&2
14
- echo Expected platform package: @dpeluche/trs-cli-win32-x64 1>&2
22
+ echo Expected package: @dpeluche/%PKG% 1>&2
23
+ echo Searched near: %DIR% 1>&2
15
24
  echo. 1>&2
16
25
  echo Alternatives: 1>&2
17
26
  echo cargo install tars-cli ^(build from source^) 1>&2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpeluche/trs",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Transform noisy terminal output into compact, structured signal. CLI toolkit for developers, automation pipelines, and AI agents. 68-90% token savings.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,10 +37,10 @@
37
37
  "compact"
38
38
  ],
39
39
  "optionalDependencies": {
40
- "@dpeluche/trs-cli-darwin-x64": "0.5.2",
41
- "@dpeluche/trs-cli-darwin-arm64": "0.5.2",
42
- "@dpeluche/trs-cli-linux-x64": "0.5.2",
43
- "@dpeluche/trs-cli-linux-arm64": "0.5.2",
44
- "@dpeluche/trs-cli-win32-x64": "0.5.2"
40
+ "@dpeluche/trs-cli-darwin-x64": "0.5.3",
41
+ "@dpeluche/trs-cli-darwin-arm64": "0.5.3",
42
+ "@dpeluche/trs-cli-linux-x64": "0.5.3",
43
+ "@dpeluche/trs-cli-linux-arm64": "0.5.3",
44
+ "@dpeluche/trs-cli-win32-x64": "0.5.3"
45
45
  }
46
46
  }