devtunnel-cli 3.0.21 → 3.0.22
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/package.json +1 -1
- package/src/core/RUN.js +17 -1
- package/src/core/start.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devtunnel-cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "DevTunnel - Share local dev servers worldwide. Zero configuration tunnel for any framework. Install via npm: npm install -g devtunnel-cli. Works with Vite, React, Next.js, Express, NestJS, Laravel (PHP), HTML, and more.",
|
|
6
6
|
"main": "src/core/start.js",
|
package/src/core/RUN.js
CHANGED
|
@@ -2,13 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// Universal Node.js Launcher - Works on ALL platforms!
|
|
4
4
|
import { spawn } from "child_process";
|
|
5
|
-
import {
|
|
5
|
+
import { readFileSync, existsSync } from "fs";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
import { dirname, join } from "path";
|
|
8
8
|
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
const __dirname = dirname(__filename);
|
|
11
11
|
|
|
12
|
+
// Version flags: devtunnel-cli --version, -v, or --v
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
const showVersion = args.some((a) => a === "--version" || a === "-v" || a === "--v");
|
|
15
|
+
if (showVersion) {
|
|
16
|
+
try {
|
|
17
|
+
const pkgPath = join(dirname(dirname(__dirname)), "package.json");
|
|
18
|
+
const version = existsSync(pkgPath)
|
|
19
|
+
? JSON.parse(readFileSync(pkgPath, "utf8")).version
|
|
20
|
+
: "?.?.?";
|
|
21
|
+
console.log(version);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
console.log("?.?.?");
|
|
24
|
+
}
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
12
28
|
const originalEmitWarning = process.emitWarning;
|
|
13
29
|
process.emitWarning = function(warning, ...args) {
|
|
14
30
|
if (typeof warning === 'string' && warning.includes('util._extend')) {
|
package/src/core/start.js
CHANGED
|
@@ -17,10 +17,10 @@ function getPackageVersion() {
|
|
|
17
17
|
const pkgPath = join(PROJECT_ROOT, "package.json");
|
|
18
18
|
if (existsSync(pkgPath)) {
|
|
19
19
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
20
|
-
return pkg.version || "3.0.
|
|
20
|
+
return pkg.version || "3.0.22";
|
|
21
21
|
}
|
|
22
22
|
} catch (err) {}
|
|
23
|
-
return "3.0.
|
|
23
|
+
return "3.0.22";
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// Helper to run command
|