@@ -12,10 +12,8 @@ import { NetService } from "@t3tools/shared/Net";
1212
1313import {
1414 DEFAULT_PORT ,
15- KEYBINDINGS_CONFIG_FILENAME ,
1615 resolveStaticDir ,
1716 ServerConfig ,
18- isDesktopMode ,
1917 type RuntimeMode ,
2018 type ServerConfigShape ,
2119} from "./config" ;
@@ -135,16 +133,14 @@ const ServerConfigLive = (input: CliInput) =>
135133 ) ;
136134
137135 const mode = Option . getOrElse ( input . mode , ( ) => env . mode ) ;
138- const isDesktop = isDesktopMode ( mode ) ;
139- const isWeb = ! isDesktop ;
140136
141137 const port = yield * Option . match ( input . port , {
142138 onSome : ( value ) => Effect . succeed ( value ) ,
143139 onNone : ( ) => {
144140 if ( env . port ) {
145141 return Effect . succeed ( env . port ) ;
146142 }
147- if ( isDesktop ) {
143+ if ( mode === "desktop" ) {
148144 return Effect . succeed ( DEFAULT_PORT ) ;
149145 }
150146 return findAvailablePort ( DEFAULT_PORT ) ;
@@ -157,15 +153,15 @@ const ServerConfigLive = (input: CliInput) =>
157153 const noBrowser = Option . match ( input . noBrowser , {
158154 // effect/cli boolean flags parse to `false` when absent; in that case
159155 // we still want env/mode fallbacks to apply.
160- onSome : ( value ) => ( value ? true : ( env . noBrowser ?? isDesktop ) ) ,
161- onNone : ( ) => env . noBrowser ?? isDesktop ,
156+ onSome : ( value ) => ( value ? true : ( env . noBrowser ?? mode === "desktop" ) ) ,
157+ onNone : ( ) => env . noBrowser ?? mode === "desktop" ,
162158 } ) ;
163159 const authToken = Option . getOrUndefined ( input . authToken ) ?? env . authToken ;
164160 const autoBootstrapProjectFromCwd = Option . match ( input . autoBootstrapProjectFromCwd , {
165161 // effect/cli boolean flags parse to `false` when absent; in that case
166162 // we still want env/mode fallbacks to apply.
167- onSome : ( value ) => ( value ? true : ( env . autoBootstrapProjectFromCwd ?? isWeb ) ) ,
168- onNone : ( ) => env . autoBootstrapProjectFromCwd ?? isWeb ,
163+ onSome : ( value ) => ( value ? true : ( env . autoBootstrapProjectFromCwd ?? mode === "web" ) ) ,
164+ onNone : ( ) => env . autoBootstrapProjectFromCwd ?? mode === "web" ,
169165 } ) ;
170166 const logWebSocketEvents = Option . match ( input . logWebSocketEvents , {
171167 // effect/cli boolean flags parse to `false` when absent; in that case
@@ -175,11 +171,11 @@ const ServerConfigLive = (input: CliInput) =>
175171 } ) ;
176172 const staticDir = devUrl ? undefined : yield * cliConfig . resolveStaticDir ;
177173 const { join } = yield * Path . Path ;
178- const keybindingsConfigPath = join ( stateDir , KEYBINDINGS_CONFIG_FILENAME ) ;
174+ const keybindingsConfigPath = join ( stateDir , "keybindings.json" ) ;
179175 const host =
180176 Option . getOrUndefined ( input . host ) ??
181177 env . host ??
182- ( isDesktop ? "127.0.0.1" : undefined ) ;
178+ ( mode === "desktop" ? "127.0.0.1" : undefined ) ;
183179
184180 return {
185181 mode,
0 commit comments