htn-tunnel 0.2.4 → 0.3.0

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/lib/install.js CHANGED
@@ -6,7 +6,7 @@ const https = require("https");
6
6
  const { execSync } = require("child_process");
7
7
 
8
8
  // Binary version from GitHub Releases.
9
- const VERSION = "0.2.0";
9
+ const VERSION = "0.3.0";
10
10
  const REPO = "nhh0718/htn-tunnel";
11
11
 
12
12
  const platform = os.platform();
@@ -57,8 +57,11 @@ async function main() {
57
57
  fs.mkdirSync(binDir, { recursive: true });
58
58
 
59
59
  if (archiveExt === ".zip") {
60
- // Windows 10+ has tar that handles zip.
61
- execSync(`tar -xf "${tmpFile}" -C "${tmpDir}"`, { stdio: "pipe" });
60
+ // Use PowerShell on Windows for reliable zip extraction.
61
+ execSync(
62
+ `powershell -NoProfile -Command "Expand-Archive -Path '${tmpFile}' -DestinationPath '${tmpDir}' -Force"`,
63
+ { stdio: "pipe" }
64
+ );
62
65
  } else {
63
66
  execSync(`tar -xzf "${tmpFile}" -C "${tmpDir}"`, { stdio: "pipe" });
64
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htn-tunnel",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "Self-hosted tunnel client — expose localhost to the internet",
5
5
  "bin": {
6
6
  "htn-tunnel": "./bin/htn-tunnel.js"
@@ -8,7 +8,14 @@
8
8
  "scripts": {
9
9
  "postinstall": "node lib/install.js"
10
10
  },
11
- "keywords": ["tunnel", "ngrok", "localhost", "expose", "dev", "htn"],
11
+ "keywords": [
12
+ "tunnel",
13
+ "ngrok",
14
+ "localhost",
15
+ "expose",
16
+ "dev",
17
+ "htn"
18
+ ],
12
19
  "license": "MIT",
13
20
  "repository": {
14
21
  "type": "git",
package/bin/htn-tunnel.js DELETED
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
- // Shim: finds and executes the htn-tunnel binary downloaded by postinstall.
3
- const path = require("path");
4
- const os = require("os");
5
- const fs = require("fs");
6
-
7
- const ext = os.platform() === "win32" ? ".exe" : "";
8
- const binPath = path.join(__dirname, `htn-tunnel${ext}`);
9
-
10
- if (!fs.existsSync(binPath)) {
11
- console.error("htn-tunnel: binary not found. Try reinstalling:");
12
- console.error(" npm install -g htn-tunnel");
13
- process.exit(1);
14
- }
15
-
16
- const result = require("child_process").spawnSync(binPath, process.argv.slice(2), {
17
- stdio: "inherit",
18
- windowsHide: false,
19
- });
20
- process.exit(result.status ?? 1);