diffsurge 0.3.0 → 0.3.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/README.md CHANGED
@@ -22,7 +22,7 @@ docker run equixankit/diffsurge-cli --help
22
22
  2. **Add it to your `.env` file** in your project root:
23
23
 
24
24
  ```env
25
- SURGE_API_KEY=tvc_live_your_key_here
25
+ SURGE_API_KEY=diffsurge_live_your_key_here
26
26
  SURGE_PROJECT_ID=your-project-uuid
27
27
  ```
28
28
 
@@ -115,11 +115,11 @@ api-check:
115
115
 
116
116
  | Variable | Description | Default |
117
117
  |---|---|---|
118
- | `SURGE_API_KEY` | Your API key (starts with `tvc_live_`) | — |
118
+ | `SURGE_API_KEY` | Your API key (starts with `diffsurge_live_`) | — |
119
119
  | `SURGE_API_URL` | API base URL | `https://api.diffsurge.com` |
120
120
  | `SURGE_PROJECT_ID` | Default project ID | — |
121
121
 
122
- All variables can also use the `TVC_` prefix (e.g., `TVC_API_KEY`) as a fallback.
122
+ All variables can also use the `DIFFSURGE_` prefix (e.g., `DIFFSURGE_API_KEY`) as a fallback.
123
123
 
124
124
  ## Flags
125
125
 
package/bin/surge CHANGED
@@ -6,8 +6,8 @@ const os = require("os");
6
6
  const fs = require("fs");
7
7
 
8
8
  const isWindows = os.platform() === "win32";
9
- const binaryName = isWindows ? "surge.exe" : "surge";
10
- const binaryPath = path.join(__dirname, binaryName);
9
+ const engineName = isWindows ? "surge-engine.exe" : "surge-engine";
10
+ const binaryPath = path.join(__dirname, engineName);
11
11
 
12
12
  // Load .env from the current working directory and merge into process.env
13
13
  function loadDotEnv() {
@@ -40,6 +40,15 @@ function loadDotEnv() {
40
40
 
41
41
  loadDotEnv();
42
42
 
43
+ // Verify the Go binary exists before attempting to execute
44
+ if (!fs.existsSync(binaryPath)) {
45
+ console.error(`surge engine binary not found at: ${binaryPath}`);
46
+ console.error(`\nThis usually means the postinstall step did not complete.`);
47
+ console.error(`Fix: run "npm rebuild diffsurge" or reinstall with "npm install -g diffsurge"`);
48
+ console.error(`Alt: use Docker instead: docker run equixankit/diffsurge-cli`);
49
+ process.exit(1);
50
+ }
51
+
43
52
  try {
44
53
  execFileSync(binaryPath, process.argv.slice(2), {
45
54
  stdio: "inherit",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/install.js CHANGED
@@ -36,10 +36,16 @@ function main() {
36
36
  const binaryName = getPlatformBinary();
37
37
  const isWindows = os.platform() === "win32";
38
38
  const binDir = path.join(__dirname, "bin");
39
- const dest = path.join(binDir, isWindows ? "surge.exe" : "surge");
39
+ const engineName = isWindows ? "surge-engine.exe" : "surge-engine";
40
+ const dest = path.join(binDir, engineName);
40
41
 
42
+ // Check if the Go binary is already extracted and is a real binary (not a text file)
41
43
  if (fs.existsSync(dest)) {
42
- return;
44
+ const stat = fs.statSync(dest);
45
+ // A real Go binary will be > 1MB; skip re-extraction if it looks valid
46
+ if (stat.size > 1024 * 1024) {
47
+ return;
48
+ }
43
49
  }
44
50
 
45
51
  const gzPath = path.join(__dirname, "binaries", `${binaryName}.gz`);
@@ -62,7 +68,7 @@ function main() {
62
68
  fs.chmodSync(dest, 0o755);
63
69
  }
64
70
 
65
- console.log("surge installed successfully!");
71
+ console.log(`surge installed successfully! (${engineName}, ${(decompressed.length / 1024 / 1024).toFixed(1)} MB)`);
66
72
  }
67
73
 
68
74
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffsurge",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Diffsurge CLI — API traffic capture, diff, schema comparison, replay, and CI/CD checks with API key auth",
5
5
  "keywords": [
6
6
  "api",
@@ -12,13 +12,13 @@
12
12
  "proxy",
13
13
  "cli"
14
14
  ],
15
- "homepage": "https://github.com/ankit12301/tvc#readme",
15
+ "homepage": "https://github.com/ankit12301/diffsurge#readme",
16
16
  "bugs": {
17
- "url": "https://github.com/ankit12301/tvc/issues"
17
+ "url": "https://github.com/ankit12301/diffsurge/issues"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "https://github.com/ankit12301/tvc.git"
21
+ "url": "https://github.com/ankit12301/diffsurge.git"
22
22
  },
23
23
  "license": "MIT",
24
24
  "author": "Ankit Mahopatra",
@@ -31,4 +31,4 @@
31
31
  "engines": {
32
32
  "node": ">=16"
33
33
  }
34
- }
34
+ }