@@ -6,6 +6,7 @@ export interface TunnelConfig {
66 projectSlug : string ;
77 deviceSecret : string ;
88 port : number ;
9+ previewPath ?: string ;
910}
1011
1112const PRIMARY_CONFIG_FILE = "spawndock.dev-tunnel.json" ;
@@ -46,8 +47,10 @@ function normalizeConfig(data: unknown): Partial<TunnelConfig> {
4647 : typeof record . localPort === "number"
4748 ? record . localPort
4849 : undefined ;
50+ const previewPath =
51+ typeof record . previewPath === "string" ? record . previewPath : undefined ;
4952
50- return { controlPlane, projectSlug, deviceSecret, port } ;
53+ return { controlPlane, projectSlug, deviceSecret, port, previewPath } ;
5154}
5255
5356function readConfigFile ( dir : string ) : Partial < TunnelConfig > {
@@ -134,10 +137,11 @@ export function resolveConfig(
134137 const projectSlug = args . projectSlug ?? env . projectSlug ?? file . projectSlug ;
135138 const deviceSecret = args . deviceSecret ?? env . deviceSecret ?? file . deviceSecret ;
136139 const port = args . port ?? env . port ?? file . port ?? 3000 ;
140+ const previewPath = file . previewPath ;
137141
138142 if ( ! controlPlane ) throw new Error ( "Missing --control-plane or SPAWNDOCK_CONTROL_PLANE" ) ;
139143 if ( ! projectSlug ) throw new Error ( "Missing --project-slug or SPAWNDOCK_PROJECT_SLUG" ) ;
140144 if ( ! deviceSecret ) throw new Error ( "Missing --device-secret or SPAWNDOCK_DEVICE_SECRET" ) ;
141145
142- return { controlPlane, projectSlug, deviceSecret, port } ;
146+ return { controlPlane, projectSlug, deviceSecret, port, previewPath } ;
143147}
0 commit comments