@stacksjs/tunnel 0.70.22 → 0.70.25

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/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- async function e(r){if(!r?.port)r={port:3000};return console.log("Creating local tunnel",r.port),"localTunnel"}async function l(r){return await e({port:r})}export{e as localTunnel,l as createLocalTunnel};
2
+ var q=import.meta.require;import{startLocalTunnel as E}from"localtunnels";async function z(j){let b=j||{port:3000},B={port:b.port||3000,...b.server?{server:b.server}:{},...b.subdomain?{subdomain:b.subdomain}:{},...b.verbose!==void 0?{verbose:b.verbose}:{},...b.timeout?{timeout:b.timeout}:{},...b.maxReconnectAttempts?{maxReconnectAttempts:b.maxReconnectAttempts}:{},...b.onConnect?{onConnect:b.onConnect}:{},...b.onRequest?{onRequest:b.onRequest}:{},...b.onResponse?{onResponse:b.onResponse}:{},...b.onError?{onError:b.onError}:{},...b.onReconnecting?{onReconnecting:b.onReconnecting}:{}},k=await E(B);return{url:k.getTunnelUrl(),subdomain:k.getSubdomain(),client:k,close:()=>k.disconnect()}}async function M(j){return(await z({port:j})).url}async function N(j){let{deployTunnelInfrastructure:b}=await import("localtunnels/cloud");return b(j)}async function P(j){let{destroyTunnelInfrastructure:b}=await import("localtunnels/cloud");return b(j)}export{z as localTunnel,P as destroyTunnelServer,N as deployTunnelServer,M as createLocalTunnel};
@@ -0,0 +1,29 @@
1
+ /// <reference path="./shims.d.ts" />
2
+ import { localTunnel } from './tunnel';
3
+ import type { LocalTunnel, TunnelOptions } from './tunnel';
4
+ export type { LocalTunnel, TunnelOptions };
5
+ export declare function createLocalTunnel(port: number): Promise<string>;
6
+ /**
7
+ * Deploy a tunnel server to AWS EC2.
8
+ * Only needed for custom domains — localtunnel.dev is the shared default.
9
+ */
10
+ export declare function deployTunnelServer(config: {
11
+ domain: string
12
+ region?: string
13
+ instanceType?: string
14
+ prefix?: string
15
+ enableSsl?: boolean
16
+ porkbunApiKey?: string
17
+ porkbunSecretKey?: string
18
+ verbose?: boolean
19
+ }): Promise<void>;
20
+ /**
21
+ * Destroy a previously deployed tunnel server from AWS.
22
+ */
23
+ export declare function destroyTunnelServer(config: {
24
+ domain?: string
25
+ region?: string
26
+ prefix?: string
27
+ verbose?: boolean
28
+ }): Promise<void>;
29
+ export { localTunnel };
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@stacksjs/tunnel",
3
3
  "type": "module",
4
- "version": "0.70.22",
4
+ "version": "0.70.25",
5
5
  "description": "Local development tunnel.",
6
6
  "author": "Chris Breuer",
7
- "contributors": ["Chris Breuer <chris@stacksjs.org>"],
7
+ "contributors": [
8
+ "Chris Breuer <chris@stacksjs.com>"
9
+ ],
8
10
  "license": "MIT",
9
11
  "funding": "https://github.com/sponsors/chrisbbreuer",
10
12
  "homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/tunnel#readme",
@@ -16,24 +18,38 @@
16
18
  "bugs": {
17
19
  "url": "https://github.com/stacksjs/stacks/issues"
18
20
  },
19
- "keywords": ["tunnel", "local", "bun", "stacks"],
21
+ "keywords": [
22
+ "tunnel",
23
+ "local",
24
+ "bun",
25
+ "stacks"
26
+ ],
20
27
  "exports": {
21
28
  ".": {
29
+ "bun": "./src/index.ts",
30
+ "types": "./dist/index.d.ts",
22
31
  "import": "./dist/index.js"
23
32
  },
24
33
  "./*": {
34
+ "bun": "./src/*",
25
35
  "import": "./dist/*"
26
36
  }
27
37
  },
28
38
  "module": "dist/index.js",
29
39
  "types": "dist/index.d.ts",
30
- "files": ["README.md", "dist"],
40
+ "files": [
41
+ "README.md",
42
+ "dist"
43
+ ],
31
44
  "scripts": {
32
45
  "build": "bun build.ts",
33
46
  "typecheck": "bun tsc --noEmit",
34
47
  "prepublishOnly": "bun run build"
35
48
  },
49
+ "dependencies": {
50
+ "localtunnels": "^0.2.7"
51
+ },
36
52
  "devDependencies": {
37
- "@stacksjs/development": "0.70.18"
53
+ "better-dx": "^0.2.12"
38
54
  }
39
55
  }
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import type { LocalTunnel } from './tunnel';
2
- import { localTunnel } from './tunnel';
3
-
4
- export declare function createLocalTunnel(port: number): Promise<LocalTunnel>;
5
-
6
- export { localTunnel }
package/dist/tunnel.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export declare type LocalTunnel = string
2
-
3
- export async function localTunnel(options?: { port: number }): Promise<LocalTunnel> {
4
- const port = 3000
5
-
6
- if (!options?.port)
7
- options = { port }
8
-
9
- console.log('Creating local tunnel', options.port)
10
-
11
- return 'localTunnel'
12
- }