devtunnel-cli 3.0.4 → 3.0.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devtunnel-cli",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "type": "module",
5
5
  "description": "Share local dev servers worldwide - Zero config tunnel for any framework",
6
6
  "main": "src/core/start.js",
package/src/core/index.js CHANGED
@@ -28,12 +28,15 @@ if (!PORT || isNaN(PORT) || PORT < 1 || PORT > 65535) {
28
28
  let tunnelProcess;
29
29
  let currentTunnelType = null;
30
30
 
31
+ console.log("");
31
32
  console.log("DevTunnel Tunnel Service");
32
33
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
33
34
  console.log(`Project: ${PROJECT_NAME}`);
34
35
  console.log(`Port: ${PORT}`);
35
- console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
36
- console.log("Ensure dev server is running on port " + PORT + "\n");
36
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
37
+ console.log("");
38
+ console.log("Ensure dev server is running on port " + PORT);
39
+ console.log("");
37
40
 
38
41
  // Check if project is Vite and auto-fix config for Cloudflare
39
42
  async function fixViteConfigForCloudflare() {
@@ -176,7 +179,9 @@ const TUNNEL_SERVICES = [
176
179
 
177
180
  // Try each tunnel service
178
181
  async function tryTunnelServices() {
179
- console.log("Checking available tunnel services...\n");
182
+ console.log("");
183
+ console.log("Checking available tunnel services...");
184
+ console.log("");
180
185
 
181
186
  let hasCloudflare = false;
182
187
 
@@ -207,7 +212,8 @@ async function tryTunnelServices() {
207
212
 
208
213
  // Skip Vite auto-fix - using proxy server instead
209
214
 
210
- console.log(`Starting ${service.name} tunnel...\n`);
215
+ console.log(`Starting ${service.name} tunnel...`);
216
+ console.log("");
211
217
 
212
218
  currentTunnelType = service.name;
213
219
  tunnelProcess = spawn(service.command, service.args, {
@@ -227,7 +233,8 @@ async function tryTunnelServices() {
227
233
  console.log("Note: First-time visitors need to enter tunnel password (your public IP)");
228
234
  console.log("Get password at: https://loca.lt/mytunnelpassword\n");
229
235
  }
230
- console.log("Press Ctrl+C to stop the tunnel\n");
236
+ console.log("Press Ctrl+C to stop the tunnel");
237
+ console.log("");
231
238
  return true;
232
239
  }
233
240
  } else {
@@ -263,11 +270,13 @@ function setupTunnelHandlers(serviceName) {
263
270
  const urlMatch = trimmed.match(/(https?:\/\/[^\s]+trycloudflare\.com[^\s]*)/);
264
271
  if (urlMatch) {
265
272
  const url = urlMatch[1];
266
- console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
273
+ console.log("");
274
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
267
275
  console.log("PUBLIC URL:");
268
276
  console.log(url);
269
277
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
270
- console.log("Share this URL with anyone!\n");
278
+ console.log("Share this URL with anyone!");
279
+ console.log("");
271
280
  }
272
281
  }
273
282
  // Show other important messages (but filter out most INF/WRN logs)
@@ -277,10 +286,12 @@ function setupTunnelHandlers(serviceName) {
277
286
  } else if (serviceName === "Ngrok") {
278
287
  if (trimmed.includes("https://") || trimmed.includes("http://")) {
279
288
  const url = trimmed;
280
- console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
289
+ console.log("");
290
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
281
291
  console.log("PUBLIC URL:");
282
292
  console.log(url);
283
- console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
293
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
294
+ console.log("");
284
295
  }
285
296
  } else {
286
297
  // LocalTunnel or other services
@@ -288,10 +299,12 @@ function setupTunnelHandlers(serviceName) {
288
299
  const urlMatch = trimmed.match(/https?:\/\/[^\s]+/);
289
300
  if (urlMatch) {
290
301
  const url = urlMatch[0];
291
- console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
302
+ console.log("");
303
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
292
304
  console.log("PUBLIC URL:");
293
305
  console.log(url);
294
- console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
306
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
307
+ console.log("");
295
308
  }
296
309
  }
297
310
  }
@@ -306,11 +319,13 @@ function setupTunnelHandlers(serviceName) {
306
319
  const urlMatch = output.match(/(https?:\/\/[^\s]+trycloudflare\.com[^\s]*)/);
307
320
  if (urlMatch) {
308
321
  const url = urlMatch[1];
309
- console.log("\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
322
+ console.log("");
323
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
310
324
  console.log("PUBLIC URL:");
311
325
  console.log(url);
312
326
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
313
- console.log("Share this URL with anyone!\n");
327
+ console.log("Share this URL with anyone!");
328
+ console.log("");
314
329
  }
315
330
  }
316
331
 
@@ -52,6 +52,7 @@ server.on("upgrade", (req, socket, head) => {
52
52
 
53
53
  // Start server
54
54
  server.listen(PROXY_PORT, () => {
55
+ console.log("");
55
56
  console.log("DevTunnel Proxy Server");
56
57
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
57
58
  console.log(`Project: ${PROJECT_NAME}`);
@@ -59,7 +60,8 @@ server.listen(PROXY_PORT, () => {
59
60
  console.log(`Proxy Port: ${PROXY_PORT}`);
60
61
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
61
62
  console.log("Ready! Tunnel will connect to proxy");
62
- console.log("No config changes needed\n");
63
+ console.log("No config changes needed");
64
+ console.log("");
63
65
  });
64
66
 
65
67
  // Handle shutdown
package/src/core/start.js CHANGED
@@ -38,14 +38,16 @@ async function commandExists(command) {
38
38
  // ASCII Logo - Compatible with all OS and terminals
39
39
  function showLogo() {
40
40
  console.log("");
41
- console.log(" _____ _____ _ _ ");
42
- console.log(" | __ \\ |_ _| | | |");
43
- console.log(" | | | |_ _ ___ | |_ _ _ __ ___ ___| | |");
44
- console.log(" | | | | | | |/ _ \\| | | | | '_ \\ / _ \\/ _ \\ | |");
45
- console.log(" | |__| | |_| | __/| | |_| | | | | __/ __/ | |");
46
- console.log(" |_____/ \\__, |\\___|\\_/\\__,_|_| |_|\\___|\\___|_|_|");
47
- console.log(" __/ | ");
48
- console.log(" |___/ ");
41
+ console.log(" ██████████ ███████████ ████ ");
42
+ console.log("▒▒███▒▒▒▒███ ▒█▒▒▒███▒▒▒█ ▒▒███ ");
43
+ console.log(" ▒███ ▒▒███ ██████ █████ █████▒ ▒███ ▒ █████ ████ ████████ ████████ ██████ ▒███ ");
44
+ console.log(" ▒███ ▒███ ███▒▒███▒▒███ ▒▒███ ▒███ ▒▒███ ▒███ ▒▒███▒▒███ ▒▒███▒▒███ ███▒▒███ ▒███ ");
45
+ console.log(" ▒███ ▒███▒███████ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███████ ▒███ ");
46
+ console.log(" ▒███ ███ ▒███▒▒▒ ▒▒███ ███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███ ▒███▒▒▒ ▒███ ");
47
+ console.log(" ██████████ ▒▒██████ ▒▒█████ █████ ▒▒████████ ████ █████ ████ █████▒▒██████ █████");
48
+ console.log("▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒ ");
49
+ console.log(" ");
50
+ console.log(" ");
49
51
  console.log("");
50
52
  }
51
53
 
@@ -59,13 +61,15 @@ async function main() {
59
61
  // Show ASCII logo
60
62
  showLogo();
61
63
 
62
- console.log("DevTunnel v3.0.4");
64
+ console.log("DevTunnel v3.0.6");
63
65
  console.log("Share your local dev servers worldwide");
66
+ console.log("");
64
67
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
65
68
  console.log("Developer: maiz");
66
69
  console.log("Repository: https://github.com/maiz-an/DevTunnel");
67
70
  console.log("Website: https://devtunnel.vercel.app");
68
- console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
71
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
72
+ console.log("");
69
73
 
70
74
  // Step 1: Check Node.js
71
75
  console.log("[1/4] Checking Node.js...");
@@ -74,7 +78,8 @@ async function main() {
74
78
  console.log("Install from: https://nodejs.org/");
75
79
  process.exit(1);
76
80
  }
77
- console.log("SUCCESS: Node.js installed\n");
81
+ console.log("SUCCESS: Node.js installed");
82
+ console.log("");
78
83
 
79
84
  // Step 2: Check Cloudflare (bundled or system-installed)
80
85
  console.log("[2/4] Checking Cloudflare...");
@@ -92,7 +97,8 @@ async function main() {
92
97
  cloudflareAvailable = true;
93
98
  } else {
94
99
  console.log("First time setup - Downloading Cloudflare...");
95
- console.log("This only happens once (~40MB, 10-30 seconds)\n");
100
+ console.log("This only happens once (~40MB, 10-30 seconds)");
101
+ console.log("");
96
102
 
97
103
  try {
98
104
  const bundledPath = await setupCloudflared();
@@ -102,11 +108,13 @@ async function main() {
102
108
  cloudflareAvailable = true;
103
109
  } else {
104
110
  console.log("Could not download Cloudflare");
105
- console.log("Will use alternative tunnel services\n");
111
+ console.log("Will use alternative tunnel services");
112
+ console.log("");
106
113
  }
107
114
  } catch (err) {
108
115
  console.log(`Setup error: ${err.message}`);
109
- console.log("Will use alternative tunnel services\n");
116
+ console.log("Will use alternative tunnel services");
117
+ console.log("");
110
118
  }
111
119
  }
112
120
 
@@ -123,14 +131,17 @@ async function main() {
123
131
  console.log("[3/4] Checking dependencies...");
124
132
  const nodeModulesPath = join(PROJECT_ROOT, "node_modules");
125
133
  if (!existsSync(nodeModulesPath)) {
126
- console.log("Installing dependencies...\n");
134
+ console.log("Installing dependencies...");
135
+ console.log("");
127
136
  // Run npm install in the project root directory
128
137
  const result = await runCommand("npm", ["install"], PROJECT_ROOT);
129
138
  if (result.code !== 0) {
130
- console.log("\nERROR: npm install failed");
139
+ console.log("");
140
+ console.log("ERROR: npm install failed");
131
141
  process.exit(1);
132
142
  }
133
- console.log("\nSUCCESS: Dependencies installed");
143
+ console.log("");
144
+ console.log("SUCCESS: Dependencies installed");
134
145
  } else {
135
146
  console.log("SUCCESS: Dependencies already installed");
136
147
  }
@@ -138,7 +149,8 @@ async function main() {
138
149
 
139
150
  // Step 4: Select folder using native OS dialog
140
151
  console.log("[4/4] Select your project folder...");
141
- console.log("Opening folder picker...\n");
152
+ console.log("Opening folder picker...");
153
+ console.log("");
142
154
 
143
155
  const projectPath = await selectFolder();
144
156
 
@@ -148,7 +160,8 @@ async function main() {
148
160
  }
149
161
 
150
162
  const projectName = basename(projectPath);
151
- console.log(`Selected: ${projectPath}\n`);
163
+ console.log(`Selected: ${projectPath}`);
164
+ console.log("");
152
165
 
153
166
  // Get port
154
167
  const portResponse = await prompts({
@@ -166,15 +179,18 @@ async function main() {
166
179
  const devPort = portResponse.port;
167
180
  const proxyPort = devPort + 1000; // Use port 1000 higher for proxy
168
181
 
169
- console.log("\nConfiguration:");
182
+ console.log("");
183
+ console.log("Configuration:");
170
184
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
171
185
  console.log(`Project: ${projectName}`);
172
186
  console.log(`Dev Server: localhost:${devPort}`);
173
187
  console.log(`Proxy Port: ${proxyPort}`);
174
- console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
188
+ console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━");
189
+ console.log("");
175
190
 
176
191
  // Start proxy server
177
- console.log("Starting services...\n");
192
+ console.log("Starting services...");
193
+ console.log("");
178
194
  const proxyPath = join(__dirname, "proxy-server.js");
179
195
  const proxyProcess = spawn("node", [proxyPath, devPort.toString(), proxyPort.toString(), projectName], {
180
196
  stdio: "inherit",