hyperstack-cli 0.3.10 → 0.3.13

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/README.md +7 -5
  2. package/bin/hs.js +24 -2
  3. package/package.json +2 -3
package/README.md CHANGED
@@ -28,11 +28,13 @@ cargo install hyperstack-cli
28
28
 
29
29
  | Command | Description |
30
30
  |---------|-------------|
31
- | `hs create [name]` | Scaffold a new app from a template |
32
- | `hs init` | Initialize a stack project |
33
- | `hs up` | Deploy your stack |
34
- | `hs status` | Show project overview |
35
- | `hs auth login` | Authenticate with Hyperstack |
31
+ | `hyperstack-cli create [name]` | Scaffold a new app from a template |
32
+ | `hyperstack-cli init` | Initialize a stack project |
33
+ | `hyperstack-cli up` | Deploy your stack |
34
+ | `hyperstack-cli status` | Show project overview |
35
+ | `hyperstack-cli auth login` | Authenticate with Hyperstack |
36
+
37
+ Note: If installed via Cargo, the command is `hs` instead of `hyperstack-cli`.
36
38
 
37
39
  ## Documentation
38
40
 
package/bin/hs.js CHANGED
@@ -5,9 +5,31 @@ const path = require("path");
5
5
  const fs = require("fs");
6
6
 
7
7
  const binName = process.platform === "win32" ? "hs.exe" : "hs";
8
- const binPath = path.join(__dirname, binName);
8
+ const localBinPath = path.join(__dirname, binName);
9
9
 
10
- if (!fs.existsSync(binPath)) {
10
+ // Try local binary first, then fall back to PATH
11
+ function getBinaryPath() {
12
+ // 1. Check for bundled binary (npm postinstall)
13
+ if (fs.existsSync(localBinPath)) {
14
+ return localBinPath;
15
+ }
16
+
17
+ // 2. Check system PATH (cargo install, manual install)
18
+ const whichCmd = process.platform === "win32" ? "where" : "which";
19
+ const result = spawnSync(whichCmd, ["hs"], { encoding: "utf8" });
20
+ if (result.status === 0 && result.stdout) {
21
+ const systemBin = result.stdout.trim().split("\n")[0];
22
+ if (fs.existsSync(systemBin)) {
23
+ return systemBin;
24
+ }
25
+ }
26
+
27
+ return null;
28
+ }
29
+
30
+ const binPath = getBinaryPath();
31
+
32
+ if (!binPath) {
11
33
  console.error(
12
34
  "Hyperstack CLI binary not found. This usually means the postinstall script failed.\n" +
13
35
  "Try reinstalling: npm install hyperstack-cli\n" +
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "hyperstack-cli",
3
- "version": "0.3.10",
3
+ "version": "0.3.13",
4
4
  "description": "Hyperstack CLI - Real-time Solana streaming pipelines",
5
5
  "bin": {
6
- "hs": "./bin/hs.js",
7
- "hyperstack": "./bin/hs.js"
6
+ "hyperstack-cli": "./bin/hs.js"
8
7
  },
9
8
  "scripts": {
10
9
  "postinstall": "node scripts/postinstall.js"