@dpeluche/trs 0.5.1 → 0.5.2
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 +47 -58
- package/bin/trs.cmd +22 -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,54 @@
|
|
|
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
|
+
# Default path: sibling package in node_modules/@dpeluche/
|
|
36
|
+
BIN="$DIR/../../trs-cli-$OS-$ARCH/trs"
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
+
# Env override for custom builds / debugging
|
|
39
|
+
if [ -n "${TRS_BINARY:-}" ]; then
|
|
40
|
+
BIN="$TRS_BINARY"
|
|
41
|
+
fi
|
|
38
42
|
|
|
39
|
-
if
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
if [ ! -x "$BIN" ]; then
|
|
44
|
+
echo "trs: binary not found at $BIN" >&2
|
|
45
|
+
echo "" >&2
|
|
46
|
+
echo "Expected platform package: @dpeluche/trs-cli-$OS-$ARCH" >&2
|
|
47
|
+
echo "" >&2
|
|
48
|
+
echo "Alternatives:" >&2
|
|
49
|
+
echo " cargo install tars-cli # build from source" >&2
|
|
50
|
+
echo " brew install trs # macOS (when available)" >&2
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
const result = require("child_process").spawnSync(binPath, process.argv.slice(2), {
|
|
49
|
-
shell: false,
|
|
50
|
-
stdio: "inherit",
|
|
51
|
-
});
|
|
52
|
-
if (result.error) {
|
|
53
|
-
throw result.error;
|
|
54
|
-
}
|
|
55
|
-
process.exitCode = result.status;
|
|
56
|
-
} else {
|
|
57
|
-
console.error(
|
|
58
|
-
`trs: no prebuilt binary for ${platform}-${arch}.\n\n` +
|
|
59
|
-
`Supported: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64\n\n` +
|
|
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
|
-
}
|
|
54
|
+
exec "$BIN" "$@"
|
package/bin/trs.cmd
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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 "BIN=%DIR%..\..\trs-cli-win32-x64\trs.exe"
|
|
8
|
+
|
|
9
|
+
if defined TRS_BINARY set "BIN=%TRS_BINARY%"
|
|
10
|
+
|
|
11
|
+
if not exist "%BIN%" (
|
|
12
|
+
echo trs: binary not found at %BIN% 1>&2
|
|
13
|
+
echo. 1>&2
|
|
14
|
+
echo Expected platform package: @dpeluche/trs-cli-win32-x64 1>&2
|
|
15
|
+
echo. 1>&2
|
|
16
|
+
echo Alternatives: 1>&2
|
|
17
|
+
echo cargo install tars-cli ^(build from source^) 1>&2
|
|
18
|
+
exit /b 1
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
"%BIN%" %*
|
|
22
|
+
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.2",
|
|
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.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"
|
|
44
45
|
}
|
|
45
46
|
}
|