@tnldotdev/tnl 0.1.0-rc.36 → 0.1.0-rc.38

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.
@@ -67,6 +67,35 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67
67
  SOFTWARE.
68
68
 
69
69
 
70
+ --------------------------------------------------------------------------------
71
+ Package: github.com/matoous/go-nanoid/v2
72
+ Version: v2.1.0
73
+ License: MIT
74
+ License source: https://github.com/matoous/go-nanoid/blob/v2.1.0/LICENSE
75
+
76
+ The MIT License (MIT)
77
+
78
+ Copyright (c) 2018 Matous Dzivjak <matousdzivjak@gmail.com>
79
+
80
+ Permission is hereby granted, free of charge, to any person obtaining a copy
81
+ of this software and associated documentation files (the "Software"), to deal
82
+ in the Software without restriction, including without limitation the rights
83
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
84
+ copies of the Software, and to permit persons to whom the Software is
85
+ furnished to do so, subject to the following conditions:
86
+
87
+ The above copyright notice and this permission notice shall be included in
88
+ all copies or substantial portions of the Software.
89
+
90
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
91
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
92
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
93
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
94
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
95
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
96
+ THE SOFTWARE.
97
+
98
+
70
99
  --------------------------------------------------------------------------------
71
100
  Package: go.yaml.in/yaml/v3
72
101
  Version: v3.0.5
@@ -8,19 +8,23 @@ export interface TnlConfig {
8
8
  */
9
9
  team?: string;
10
10
  /**
11
- * Default route and tunnel settings.
11
+ * Default public URL and tunnel settings.
12
12
  */
13
13
  tunnel?: {
14
14
  /**
15
- * Complete public URL hostname to publish.
15
+ * Ready team domain used for generated public URL hostnames.
16
16
  */
17
- host?: string;
17
+ domain?: string;
18
18
  /**
19
- * One DNS label beneath the current namespace.
19
+ * One DNS label beneath the member namespace.
20
20
  */
21
- subdomain?: string;
21
+ name?: string;
22
22
  /**
23
- * Remove the route when this tunnel stops.
23
+ * Open the public URL in a browser once ready.
24
+ */
25
+ open?: boolean;
26
+ /**
27
+ * Remove the public URL when this tunnel stops.
24
28
  */
25
29
  ephemeral?: boolean;
26
30
  /**
@@ -28,13 +32,19 @@ export interface TnlConfig {
28
32
  */
29
33
  allowAllIPs?: boolean;
30
34
  /**
31
- * Visitor IP addresses or prefixes allowed to use the route; the current client IP is added automatically.
32
- *
33
- * @maxItems 63
35
+ * Visitor IP addresses or prefixes allowed to use the public URL; the current client IP is added automatically.
34
36
  */
35
37
  allowIP?: string[];
36
38
  /**
37
- * Maximum concurrent requests forwarded by the publisher for this route, including streams and upgrades.
39
+ * Webhook providers whose published IP addresses may visit the public URL; resolved when the tunnel starts.
40
+ */
41
+ allowProviders?: ("github" | "stripe")[];
42
+ /**
43
+ * Exact HTTPS public URL to publish.
44
+ */
45
+ publicURL?: string;
46
+ /**
47
+ * Maximum concurrent requests forwarded by the publisher for this public URL, including streams and upgrades.
38
48
  */
39
49
  requestLimit?: number;
40
50
  };
@@ -62,15 +72,19 @@ export interface TnlConfig {
62
72
  */
63
73
  tunnel?: {
64
74
  /**
65
- * Complete public URL hostname to publish.
75
+ * Ready team domain used for generated public URL hostnames.
66
76
  */
67
- host?: string;
77
+ domain?: string;
68
78
  /**
69
- * One DNS label beneath the current namespace.
79
+ * One DNS label beneath the member namespace.
70
80
  */
71
- subdomain?: string;
81
+ name?: string;
72
82
  /**
73
- * Remove the route when this tunnel stops.
83
+ * Open the public URL in a browser once ready.
84
+ */
85
+ open?: boolean;
86
+ /**
87
+ * Remove the public URL when this tunnel stops.
74
88
  */
75
89
  ephemeral?: boolean;
76
90
  /**
@@ -78,13 +92,19 @@ export interface TnlConfig {
78
92
  */
79
93
  allowAllIPs?: boolean;
80
94
  /**
81
- * Visitor IP addresses or prefixes allowed to use the route; the current client IP is added automatically.
82
- *
83
- * @maxItems 63
95
+ * Visitor IP addresses or prefixes allowed to use the public URL; the current client IP is added automatically.
84
96
  */
85
97
  allowIP?: string[];
86
98
  /**
87
- * Maximum concurrent requests forwarded by the publisher for this route, including streams and upgrades.
99
+ * Webhook providers whose published IP addresses may visit the public URL; resolved when the tunnel starts.
100
+ */
101
+ allowProviders?: ("github" | "stripe")[];
102
+ /**
103
+ * Exact HTTPS public URL to publish.
104
+ */
105
+ publicURL?: string;
106
+ /**
107
+ * Maximum concurrent requests forwarded by the publisher for this public URL, including streams and upgrades.
88
108
  */
89
109
  requestLimit?: number;
90
110
  };
@@ -118,7 +138,7 @@ export interface Dev {
118
138
  /** The Git worktree or project directory that contains tnl.config.ts. */
119
139
  export interface TnlWorktree {
120
140
  readonly isGit: boolean;
121
- /** DNS-safe worktree label derived from this worktree and client state. */
141
+ /** DNS-safe project/worktree label derived from this checkout and client state. */
122
142
  readonly label: string;
123
143
  readonly name: string;
124
144
  readonly root: string;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { developmentPort } from "./internal/port.js";
2
2
  import { parseRuntimePayload } from "./internal/runtime.js";
3
3
  const serializedRuntime = typeof process === "undefined" ? undefined : process.env?.TNL_PROJECT_RUNTIME;
4
4
  /** Server port and optional browser-safe project metadata for this process. */
5
- // The parser validates the runtime shape; generated project declarations supply
5
+ // the parser validates the runtime shape; generated project declarations supply
6
6
  // project-specific service names and literals unavailable to this shared module.
7
7
  const runtime = parseRuntimePayload(serializedRuntime);
8
8
  export const tnl = Object.freeze({
@@ -28,7 +28,7 @@ export interface TnlTunnelAssignment extends TnlDevBootstrap {
28
28
  readonly project: ProjectRuntime;
29
29
  readonly publicURL: `https://${string}`;
30
30
  readonly service: string | null;
31
- readonly tunnelID: `tunnel_${string}`;
31
+ readonly tunnelID: `tun_${string}`;
32
32
  }
33
33
  export type CanonicalLoopbackTarget = `http://${string}`;
34
34
  export declare function readDevelopmentContext(environment?: TnlDevEnvironment, cwd?: string): DevelopmentContext;
@@ -91,7 +91,7 @@ export function discoverProject(cwd) {
91
91
  throw error;
92
92
  }
93
93
  }
94
- // A nested repository or Git worktree must not inherit an unrelated
94
+ // a nested repository or Git worktree must not inherit an unrelated
95
95
  // ancestor's browser-safe project metadata.
96
96
  try {
97
97
  fs.lstatSync(path.join(directory, ".git"));
@@ -161,7 +161,7 @@ function parseAssignment(value, bootstrap, framework) {
161
161
  if (object.protocol !== 1) {
162
162
  throw new Error("tnl dev returned an inconsistent tunnel assignment");
163
163
  }
164
- if (typeof object.tunnelID !== "string" || !/^tunnel_[a-f0-9]{32}$/.test(object.tunnelID)) {
164
+ if (typeof object.tunnelID !== "string" || !/^tun_[A-Za-z0-9]{22}$/.test(object.tunnelID)) {
165
165
  throw new Error("tnl dev returned an invalid tunnel ID");
166
166
  }
167
167
  if (object.service !== null && !validServiceName(object.service)) {
@@ -94,12 +94,25 @@ export function requiredHostname(value, description) {
94
94
  if (labels.some((label) => label.length === 0 || label.length > 63 || !/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label))) {
95
95
  throw new Error(`${description} is invalid`);
96
96
  }
97
+ for (const label of labels) {
98
+ if (label.startsWith("xn--") && !validALabel(label)) {
99
+ throw new Error(`${description} is invalid`);
100
+ }
101
+ }
97
102
  if (labels.length === 4 &&
98
103
  labels.every((label) => /^[0-9]+$/.test(label) && Number(label) <= 255)) {
99
104
  throw new Error(`${description} is invalid`);
100
105
  }
101
106
  return value;
102
107
  }
108
+ function validALabel(label) {
109
+ try {
110
+ return new URL(`https://${label}.example`).hostname === `${label}.example`;
111
+ }
112
+ catch {
113
+ return false;
114
+ }
115
+ }
103
116
  export function exactKeys(object, expected, description) {
104
117
  const keys = Object.keys(object).sort();
105
118
  const sortedExpected = [...expected].sort();
package/dist/vite.js CHANGED
@@ -41,7 +41,7 @@ export default function tnl(...arguments_) {
41
41
  server: {
42
42
  ...result.server,
43
43
  port: development.bootstrap.port,
44
- // Let Vite report a fallback listener so tnl can reject it with the target diagnostic.
44
+ // let Vite report a fallback listener so tnl can reject it with the target diagnostic.
45
45
  strictPort: false,
46
46
  },
47
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tnldotdev/tnl",
3
- "version": "0.1.0-rc.36",
3
+ "version": "0.1.0-rc.38",
4
4
  "bin": {
5
5
  "tnl": "dist/bin/tnl.js"
6
6
  },
@@ -67,7 +67,7 @@
67
67
  "@hono/node-server": "2.1.1",
68
68
  "@types/bun": "1.4.2",
69
69
  "hono": "4.13.9",
70
- "next": "16.3.5",
70
+ "next": "16.3.6",
71
71
  "react": "19.3.0",
72
72
  "react-dom": "19.3.0",
73
73
  "vite": "8.3.0"
@@ -88,12 +88,12 @@
88
88
  "node": ">=22.18"
89
89
  },
90
90
  "optionalDependencies": {
91
- "@tnldotdev/tnl-darwin-arm64": "0.1.0-rc.36",
92
- "@tnldotdev/tnl-darwin-x64": "0.1.0-rc.36",
93
- "@tnldotdev/tnl-linux-arm64": "0.1.0-rc.36",
94
- "@tnldotdev/tnl-linux-x64": "0.1.0-rc.36"
91
+ "@tnldotdev/tnl-darwin-arm64": "0.1.0-rc.38",
92
+ "@tnldotdev/tnl-darwin-x64": "0.1.0-rc.38",
93
+ "@tnldotdev/tnl-linux-arm64": "0.1.0-rc.38",
94
+ "@tnldotdev/tnl-linux-x64": "0.1.0-rc.38"
95
95
  },
96
96
  "tnl": {
97
- "commit": "9e9f174b00ddfbd75b1e6ce3579875cd06c2a6d5"
97
+ "commit": "ea453d5ca0c1fd4591554eec7ccf5e1d019f41dc"
98
98
  }
99
99
  }
package/readme.md CHANGED
@@ -6,9 +6,9 @@ or newer. The package selects a native binary through optional dependencies;
6
6
  it does not install the `tnld` server.
7
7
 
8
8
  ```console
9
- pnpm add -D @tnldotdev/tnl@next
10
- pnpm exec tnl init
11
- pnpm exec tnl dev
9
+ npm install -D @tnldotdev/tnl@next
10
+ npx tnl init
11
+ npx tnl dev
12
12
  ```
13
13
 
14
14
  `tnl init` sets up missing project and framework configuration and lists any