@tnldotdev/tnl 0.1.0-rc.36 → 0.1.0-rc.37
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/config.gen.d.ts +40 -20
- package/dist/index.js +1 -1
- package/dist/internal/dev.js +1 -1
- package/dist/internal/runtime.js +13 -0
- package/dist/vite.js +1 -1
- package/package.json +7 -7
- package/readme.md +3 -3
package/dist/config.gen.d.ts
CHANGED
|
@@ -8,19 +8,23 @@ export interface TnlConfig {
|
|
|
8
8
|
*/
|
|
9
9
|
team?: string;
|
|
10
10
|
/**
|
|
11
|
-
* Default
|
|
11
|
+
* Default public URL and tunnel settings.
|
|
12
12
|
*/
|
|
13
13
|
tunnel?: {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Ready team domain used for generated public URL hostnames.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
domain?: string;
|
|
18
18
|
/**
|
|
19
|
-
* One DNS label beneath the
|
|
19
|
+
* One DNS label beneath the member namespace.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
name?: string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
75
|
+
* Ready team domain used for generated public URL hostnames.
|
|
66
76
|
*/
|
|
67
|
-
|
|
77
|
+
domain?: string;
|
|
68
78
|
/**
|
|
69
|
-
* One DNS label beneath the
|
|
79
|
+
* One DNS label beneath the member namespace.
|
|
70
80
|
*/
|
|
71
|
-
|
|
81
|
+
name?: string;
|
|
72
82
|
/**
|
|
73
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|
-
//
|
|
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({
|
package/dist/internal/dev.js
CHANGED
|
@@ -91,7 +91,7 @@ export function discoverProject(cwd) {
|
|
|
91
91
|
throw error;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
//
|
|
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"));
|
package/dist/internal/runtime.js
CHANGED
|
@@ -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
|
-
//
|
|
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.
|
|
3
|
+
"version": "0.1.0-rc.37",
|
|
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.
|
|
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.
|
|
92
|
-
"@tnldotdev/tnl-darwin-x64": "0.1.0-rc.
|
|
93
|
-
"@tnldotdev/tnl-linux-arm64": "0.1.0-rc.
|
|
94
|
-
"@tnldotdev/tnl-linux-x64": "0.1.0-rc.
|
|
91
|
+
"@tnldotdev/tnl-darwin-arm64": "0.1.0-rc.37",
|
|
92
|
+
"@tnldotdev/tnl-darwin-x64": "0.1.0-rc.37",
|
|
93
|
+
"@tnldotdev/tnl-linux-arm64": "0.1.0-rc.37",
|
|
94
|
+
"@tnldotdev/tnl-linux-x64": "0.1.0-rc.37"
|
|
95
95
|
},
|
|
96
96
|
"tnl": {
|
|
97
|
-
"commit": "
|
|
97
|
+
"commit": "40759e1118d56dc22b299e239ea35e611b812f24"
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|