File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " shipkey" ,
3- "version" : " 0.3.5 " ,
3+ "version" : " 0.3.6 " ,
44 "type" : " module" ,
55 "workspaces" : [" packages/*" ],
66 "repository" : {
Original file line number Diff line number Diff line change @@ -479,6 +479,7 @@ function startServer(
479479
480480 return Bun . serve ( {
481481 port : port ?? 0 ,
482+ idleTimeout : 120 ,
482483 async fetch ( req ) {
483484 const url = new URL ( req . url ) ;
484485
@@ -631,12 +632,6 @@ export const setupCommand = new Command("setup")
631632 }
632633
633634 const backend = getBackend ( config . backend ) ;
634- if ( ! ( await backend . isAvailable ( ) ) ) {
635- console . warn (
636- ` Warning: ${ backend . name } CLI not available. Store/read operations will fail.\n` +
637- ` Run the setup wizard for installation instructions.\n`
638- ) ;
639- }
640635
641636 const configPath = join ( projectRoot , "shipkey.json" ) ;
642637 const port = opts . port ? parseInt ( opts . port , 10 ) : undefined ;
Original file line number Diff line number Diff line change @@ -5,31 +5,23 @@ export class CloudflareTarget implements SyncTarget {
55
66 async checkStatus ( ) : Promise < TargetStatus > {
77 try {
8- const versionProc = Bun . spawn ( [ "wrangler" , "--version" ] , {
8+ // Single call: wrangler whoami checks both installation and authentication
9+ const proc = Bun . spawn ( [ "wrangler" , "whoami" ] , {
910 stdout : "pipe" ,
1011 stderr : "pipe" ,
1112 } ) ;
12- await versionProc . exited ;
13- if ( versionProc . exitCode !== 0 ) return "not_installed" ;
14- } catch {
15- return "not_installed" ;
16- }
17-
18- try {
19- const whoamiProc = Bun . spawn ( [ "wrangler" , "whoami" ] , {
20- stdout : "pipe" ,
21- stderr : "pipe" ,
22- } ) ;
23- const stderr = await new Response ( whoamiProc . stderr ) . text ( ) ;
24- await whoamiProc . exited ;
25- if ( whoamiProc . exitCode !== 0 || stderr . includes ( "not authenticated" ) ) {
26- return "not_authenticated" ;
13+ const stderr = await new Response ( proc . stderr ) . text ( ) ;
14+ await proc . exited ;
15+ if ( proc . exitCode !== 0 ) {
16+ if ( stderr . includes ( "not authenticated" ) || stderr . includes ( "not logged" ) ) {
17+ return "not_authenticated" ;
18+ }
19+ return "not_installed" ;
2720 }
21+ return "ready" ;
2822 } catch {
29- return "not_authenticated " ;
23+ return "not_installed " ;
3024 }
31-
32- return "ready" ;
3325 }
3426
3527 async isAvailable ( ) : Promise < boolean > {
Original file line number Diff line number Diff line change @@ -5,28 +5,22 @@ export class GitHubTarget implements SyncTarget {
55
66 async checkStatus ( ) : Promise < TargetStatus > {
77 try {
8- const versionProc = Bun . spawn ( [ "gh" , "--version" ] , {
8+ // Single call: gh auth status checks both installation and authentication
9+ const proc = Bun . spawn ( [ "gh" , "auth" , "status" ] , {
910 stdout : "pipe" ,
1011 stderr : "pipe" ,
1112 } ) ;
12- await versionProc . exited ;
13- if ( versionProc . exitCode !== 0 ) return "not_installed" ;
13+ const stderr = await new Response ( proc . stderr ) . text ( ) ;
14+ await proc . exited ;
15+ if ( proc . exitCode !== 0 ) {
16+ return stderr . includes ( "not logged" ) || stderr . includes ( "no accounts" )
17+ ? "not_authenticated"
18+ : "not_installed" ;
19+ }
20+ return "ready" ;
1421 } catch {
1522 return "not_installed" ;
1623 }
17-
18- try {
19- const authProc = Bun . spawn ( [ "gh" , "auth" , "status" ] , {
20- stdout : "pipe" ,
21- stderr : "pipe" ,
22- } ) ;
23- await authProc . exited ;
24- if ( authProc . exitCode !== 0 ) return "not_authenticated" ;
25- } catch {
26- return "not_authenticated" ;
27- }
28-
29- return "ready" ;
3024 }
3125
3226 async isAvailable ( ) : Promise < boolean > {
You can’t perform that action at this time.
0 commit comments