@dpeluche/trs 0.5.1 → 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.
- package/README.md +8 -5
- package/bin/trs +65 -58
- package/bin/trs.cmd +31 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -68,11 +68,14 @@ trs git status --raw # passthrough (tracked)
|
|
|
68
68
|
|
|
69
69
|
## Supported platforms
|
|
70
70
|
|
|
71
|
-
| Platform | Architecture |
|
|
72
|
-
|
|
73
|
-
| macOS | x64, arm64 |
|
|
74
|
-
| Linux | x64, arm64 |
|
|
75
|
-
| Windows | x64 |
|
|
71
|
+
| Platform | Architecture | Notes |
|
|
72
|
+
|----------|-------------|-------|
|
|
73
|
+
| macOS | x64, arm64 | shell launcher (~12ms overhead) |
|
|
74
|
+
| Linux | x64, arm64 | shell launcher (~12ms overhead) |
|
|
75
|
+
| Windows | x64 | `.cmd` launcher (requires Windows x64) |
|
|
76
|
+
|
|
77
|
+
> The launcher `exec`s the native binary directly — no Node.js at runtime,
|
|
78
|
+
> which is why startup is on par with a Homebrew install.
|
|
76
79
|
|
|
77
80
|
## Links
|
|
78
81
|
|
package/bin/trs
CHANGED
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
#!/
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# trs — shell wrapper that execs the native binary directly.
|
|
3
|
+
# Saves ~25ms vs the previous Node wrapper by skipping the node runtime.
|
|
4
|
+
#
|
|
5
|
+
# The platform-specific binary is installed by npm as an optionalDependency
|
|
6
|
+
# into node_modules/@dpeluche/trs-cli-<os>-<arch>/trs.
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
const { execSync } = require("child_process");
|
|
8
|
+
set -e
|
|
5
9
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
# Resolve real location of this script (npm installs it as a symlink).
|
|
11
|
+
SCRIPT="$0"
|
|
12
|
+
while [ -L "$SCRIPT" ]; do
|
|
13
|
+
LINK=$(readlink "$SCRIPT")
|
|
14
|
+
case "$LINK" in
|
|
15
|
+
/*) SCRIPT="$LINK" ;;
|
|
16
|
+
*) SCRIPT="$(dirname "$SCRIPT")/$LINK" ;;
|
|
17
|
+
esac
|
|
18
|
+
done
|
|
19
|
+
DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
|
|
20
|
+
# DIR is .../node_modules/@dpeluche/trs/bin
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
22
|
+
OS=$(uname -s)
|
|
23
|
+
ARCH=$(uname -m)
|
|
24
|
+
case "$OS" in
|
|
25
|
+
Darwin) OS=darwin ;;
|
|
26
|
+
Linux) OS=linux ;;
|
|
27
|
+
*) echo "trs: unsupported OS: $OS" >&2; exit 1 ;;
|
|
28
|
+
esac
|
|
29
|
+
case "$ARCH" in
|
|
30
|
+
x86_64|amd64) ARCH=x64 ;;
|
|
31
|
+
arm64|aarch64) ARCH=arm64 ;;
|
|
32
|
+
*) echo "trs: unsupported arch: $ARCH" >&2; exit 1 ;;
|
|
33
|
+
esac
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
PKG="@dpeluche/trs-cli-$OS-$ARCH"
|
|
36
|
+
BIN=""
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
+
# Env override takes priority (custom builds / debugging)
|
|
39
|
+
if [ -n "${TRS_BINARY:-}" ] && [ -x "$TRS_BINARY" ]; then
|
|
40
|
+
BIN="$TRS_BINARY"
|
|
41
|
+
fi
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
46
59
|
|
|
47
|
-
if
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
`Alternatives:\n` +
|
|
61
|
-
` cargo install tars-cli # build from source\n` +
|
|
62
|
-
` brew install trs # macOS (when available)\n`
|
|
63
|
-
);
|
|
64
|
-
process.exitCode = 1;
|
|
65
|
-
}
|
|
60
|
+
if [ -z "$BIN" ]; then
|
|
61
|
+
echo "trs: platform binary not found" >&2
|
|
62
|
+
echo "" >&2
|
|
63
|
+
echo "Expected package: $PKG" >&2
|
|
64
|
+
echo "Searched near: $DIR" >&2
|
|
65
|
+
echo "" >&2
|
|
66
|
+
echo "Alternatives:" >&2
|
|
67
|
+
echo " cargo install tars-cli # build from source" >&2
|
|
68
|
+
echo " curl -fsSL https://raw.githubusercontent.com/dPeluChe/trs/main/scripts/install.sh | sh" >&2
|
|
69
|
+
exit 1
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
exec "$BIN" "$@"
|
package/bin/trs.cmd
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem trs launcher for Windows — execs the native binary directly.
|
|
3
|
+
rem See bin/trs for the Unix equivalent.
|
|
4
|
+
setlocal
|
|
5
|
+
|
|
6
|
+
set "DIR=%~dp0"
|
|
7
|
+
set "PKG=trs-cli-win32-x64"
|
|
8
|
+
set "BIN="
|
|
9
|
+
|
|
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"
|
|
18
|
+
|
|
19
|
+
if not defined BIN (
|
|
20
|
+
echo trs: platform binary not found 1>&2
|
|
21
|
+
echo. 1>&2
|
|
22
|
+
echo Expected package: @dpeluche/%PKG% 1>&2
|
|
23
|
+
echo Searched near: %DIR% 1>&2
|
|
24
|
+
echo. 1>&2
|
|
25
|
+
echo Alternatives: 1>&2
|
|
26
|
+
echo cargo install tars-cli ^(build from source^) 1>&2
|
|
27
|
+
exit /b 1
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
"%BIN%" %*
|
|
31
|
+
exit /b %ERRORLEVEL%
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dpeluche/trs",
|
|
3
|
-
"version": "0.5.
|
|
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": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"bin/trs",
|
|
17
|
+
"bin/trs.cmd",
|
|
17
18
|
"README.md"
|
|
18
19
|
],
|
|
19
20
|
"engines": {
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"compact"
|
|
37
38
|
],
|
|
38
39
|
"optionalDependencies": {
|
|
39
|
-
"@dpeluche/trs-cli-darwin-x64": "0.5.
|
|
40
|
-
"@dpeluche/trs-cli-darwin-arm64": "0.5.
|
|
41
|
-
"@dpeluche/trs-cli-linux-x64": "0.5.
|
|
42
|
-
"@dpeluche/trs-cli-linux-arm64": "0.5.
|
|
43
|
-
"@dpeluche/trs-cli-win32-x64": "0.5.
|
|
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"
|
|
44
45
|
}
|
|
45
46
|
}
|