@kaluarunsi/obi 0.1.4 → 0.2.1
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/bin/obi +46 -0
- package/bin/obi.cmd +3 -0
- package/lib/binary.js +1 -1
- package/package.json +4 -4
- package/release-manifest.json +7 -7
package/bin/obi
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Fast POSIX launcher — replaces the Node.js wrapper to eliminate ~450ms startup overhead.
|
|
3
|
+
# Uses exec to replace this shell process with the binary (no extra process).
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# Resolve the real location of this script, following any symlinks npm may create.
|
|
7
|
+
SCRIPT="$0"
|
|
8
|
+
while [ -L "$SCRIPT" ]; do
|
|
9
|
+
SCRIPT_DIR=$(cd "$(dirname "$SCRIPT")" && pwd)
|
|
10
|
+
SCRIPT=$(readlink "$SCRIPT")
|
|
11
|
+
case "$SCRIPT" in
|
|
12
|
+
/*) ;;
|
|
13
|
+
*) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;;
|
|
14
|
+
esac
|
|
15
|
+
done
|
|
16
|
+
PACKAGE_DIR=$(cd "$(dirname "$SCRIPT")/.." && pwd)
|
|
17
|
+
|
|
18
|
+
# Detect platform tuple used by the optional npm sub-packages.
|
|
19
|
+
OS=$(uname -s)
|
|
20
|
+
ARCH=$(uname -m)
|
|
21
|
+
case "$OS" in
|
|
22
|
+
Darwin)
|
|
23
|
+
case "$ARCH" in
|
|
24
|
+
arm64) PLATFORM="darwin-arm64" ;;
|
|
25
|
+
x86_64) PLATFORM="darwin-x64" ;;
|
|
26
|
+
*) printf 'obi: unsupported arch: %s\n' "$ARCH" >&2; exit 1 ;;
|
|
27
|
+
esac ;;
|
|
28
|
+
Linux)
|
|
29
|
+
case "$ARCH" in
|
|
30
|
+
x86_64|amd64) PLATFORM="linux-x64" ;;
|
|
31
|
+
aarch64) PLATFORM="linux-arm64" ;;
|
|
32
|
+
*) printf 'obi: unsupported arch: %s\n' "$ARCH" >&2; exit 1 ;;
|
|
33
|
+
esac ;;
|
|
34
|
+
*)
|
|
35
|
+
printf 'obi: unsupported OS: %s\n' "$OS" >&2; exit 1 ;;
|
|
36
|
+
esac
|
|
37
|
+
|
|
38
|
+
BINARY="$PACKAGE_DIR/node_modules/@kaluarunsi/obi-$PLATFORM/vendor/obi/obi"
|
|
39
|
+
|
|
40
|
+
if [ ! -x "$BINARY" ]; then
|
|
41
|
+
printf 'obi: binary not found for platform %s\n' "$PLATFORM" >&2
|
|
42
|
+
printf 'obi: expected at %s\n' "$BINARY" >&2
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
exec "$BINARY" "$@"
|
package/bin/obi.cmd
ADDED
package/lib/binary.js
CHANGED
|
@@ -4,7 +4,7 @@ const { detectPlatform } = require("./platform");
|
|
|
4
4
|
|
|
5
5
|
function binaryRelativePath(os, arch) {
|
|
6
6
|
const binary = os === "windows" ? "obi.exe" : "obi";
|
|
7
|
-
return path.join("vendor", binary);
|
|
7
|
+
return path.join("vendor", "obi", binary);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
function packageNameForPlatform(os, arch) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaluarunsi/obi",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Terminal-first repo-aware coding operator",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"release-manifest.json"
|
|
16
16
|
],
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@kaluarunsi/obi-darwin-arm64": "0.1
|
|
19
|
-
"@kaluarunsi/obi-linux-x64": "0.1
|
|
20
|
-
"@kaluarunsi/obi-windows-x64": "0.1
|
|
18
|
+
"@kaluarunsi/obi-darwin-arm64": "0.2.1",
|
|
19
|
+
"@kaluarunsi/obi-linux-x64": "0.2.1",
|
|
20
|
+
"@kaluarunsi/obi-windows-x64": "0.2.1"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"test": "node --test"
|
package/release-manifest.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.1
|
|
2
|
+
"version": "0.2.1",
|
|
3
3
|
"assets": {
|
|
4
4
|
"darwin-arm64": {
|
|
5
5
|
"os": "darwin",
|
|
6
6
|
"arch": "arm64",
|
|
7
7
|
"archive": "obi-darwin-arm64.tar.gz",
|
|
8
|
-
"sha256": "
|
|
9
|
-
"binary": "obi"
|
|
8
|
+
"sha256": "211429b2ce1b6db6bf744322916c291ab0368e7ac5c48235e2268ddeaf9f939c",
|
|
9
|
+
"binary": "obi/obi"
|
|
10
10
|
},
|
|
11
11
|
"linux-x64": {
|
|
12
12
|
"os": "linux",
|
|
13
13
|
"arch": "x64",
|
|
14
14
|
"archive": "obi-linux-x64.tar.gz",
|
|
15
|
-
"sha256": "
|
|
16
|
-
"binary": "obi"
|
|
15
|
+
"sha256": "b7792676f432506a56c0ed482fa019bd5dad0d3d434573b86f3163d2c4cd8f1b",
|
|
16
|
+
"binary": "obi/obi"
|
|
17
17
|
},
|
|
18
18
|
"windows-x64": {
|
|
19
19
|
"os": "windows",
|
|
20
20
|
"arch": "x64",
|
|
21
21
|
"archive": "obi-windows-x64.zip",
|
|
22
|
-
"sha256": "
|
|
23
|
-
"binary": "obi.exe"
|
|
22
|
+
"sha256": "4bdcea2766ecb2313273c9935fc36a4ed1f788981660e28b8126a4f1ac4d70c9",
|
|
23
|
+
"binary": "obi/obi.exe"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|