@stacksjs/tunnel 0.58.73 → 0.59.2

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.
@@ -0,0 +1,3 @@
1
+ import { localTunnel } from './tunnel';
2
+ export declare function createLocalTunnel(port: number): Promise<any>;
3
+ export { localTunnel };
package/dist/index.js CHANGED
@@ -1,10 +1,19 @@
1
1
  // @bun
2
+ // src/tunnel.ts
3
+ async function localTunnel(options) {
4
+ const port = 3000;
5
+ if (!options?.port)
6
+ options = { port };
7
+ console.log("Creating local tunnel", options.port);
8
+ return "localTunnel";
9
+ }
10
+
2
11
  // src/index.ts
3
- import localtunnel from "localtunnel";
4
12
  async function createLocalTunnel(port) {
5
- const tunnel = await localtunnel({ port });
6
- return tunnel.url;
13
+ const tunnel2 = await localTunnel({ port });
14
+ return tunnel2.url;
7
15
  }
8
16
  export {
17
+ localTunnel,
9
18
  createLocalTunnel
10
19
  };
@@ -0,0 +1,3 @@
1
+ export declare function localTunnel(options?: {
2
+ port: number;
3
+ }): Promise<string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/tunnel",
3
3
  "type": "module",
4
- "version": "0.58.73",
4
+ "version": "0.59.2",
5
5
  "description": "Local development tunnel.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -17,7 +17,8 @@
17
17
  },
18
18
  "keywords": [
19
19
  "tunnel",
20
- "localtunnel",
20
+ "local",
21
+ "bun",
21
22
  "stacks"
22
23
  ],
23
24
  "exports": {
@@ -45,14 +46,7 @@
45
46
  "typecheck": "bun --bun tsc --noEmit",
46
47
  "prepublishOnly": "bun --bun run build"
47
48
  },
48
- "peerDependencies": {
49
- "localtunnel": "^2.0.2"
50
- },
51
- "dependencies": {
52
- "localtunnel": "^2.0.2"
53
- },
54
49
  "devDependencies": {
55
- "@stacksjs/development": "latest",
56
- "@types/localtunnel": "^2.0.4"
50
+ "@stacksjs/development": "latest"
57
51
  }
58
52
  }
package/src/index.ts CHANGED
@@ -1,6 +1,8 @@
1
- import localtunnel from 'localtunnel'
1
+ import { localTunnel } from './tunnel'
2
2
 
3
3
  export async function createLocalTunnel(port: number) {
4
- const tunnel = await localtunnel({ port })
4
+ const tunnel = await localTunnel({ port })
5
5
  return tunnel.url
6
6
  }
7
+
8
+ export { localTunnel }
package/src/tunnel.ts ADDED
@@ -0,0 +1,11 @@
1
+ export async function localTunnel(options?: { port: number }) {
2
+ const port = 3000
3
+
4
+ if (!options?.port)
5
+ options = { port }
6
+
7
+ // eslint-disable-next-line no-console
8
+ console.log('Creating local tunnel', options.port)
9
+
10
+ return 'localTunnel'
11
+ }