File tree Expand file tree Collapse file tree 11 files changed +14
-37
lines changed
Expand file tree Collapse file tree 11 files changed +14
-37
lines changed Original file line number Diff line number Diff line change @@ -1210,7 +1210,6 @@ export const apiCommand = buildCommand({
12101210 throw new OutputError ( response . body ) ;
12111211 }
12121212
1213- yield new CommandOutput ( response . body ) ;
1214- return ;
1213+ return yield new CommandOutput ( response . body ) ;
12151214 } ,
12161215} ) ;
Original file line number Diff line number Diff line change @@ -182,8 +182,7 @@ export const loginCommand = buildCommand({
182182 // Non-fatal: user info is supplementary. Token remains stored and valid.
183183 }
184184
185- yield new CommandOutput ( result ) ;
186- return ;
185+ return yield new CommandOutput ( result ) ;
187186 }
188187
189188 // OAuth device flow
Original file line number Diff line number Diff line change @@ -105,7 +105,6 @@ Examples:
105105 : undefined ,
106106 } ;
107107
108- yield new CommandOutput ( payload ) ;
109- return ;
108+ return yield new CommandOutput ( payload ) ;
110109 } ,
111110} ) ;
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ export const statusCommand = buildCommand({
190190 verification : await verifyCredentials ( ) ,
191191 } ;
192192
193- yield new CommandOutput ( data ) ;
194- return ;
193+ return yield new CommandOutput ( data ) ;
195194 } ,
196195} ) ;
Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ export const whoamiCommand = buildCommand({
6565 // Cache update failure is non-essential — user identity was already fetched.
6666 }
6767
68- yield new CommandOutput ( user ) ;
69- return ;
68+ return yield new CommandOutput ( user ) ;
7069 } ,
7170} ) ;
Original file line number Diff line number Diff line change @@ -735,7 +735,6 @@ export const fixCommand = buildCommand({
735735 throw new OutputError ( result ) ;
736736 }
737737
738- yield new CommandOutput ( result ) ;
739- return ;
738+ return yield new CommandOutput ( result ) ;
740739 } ,
741740} ) ;
Original file line number Diff line number Diff line change @@ -494,8 +494,7 @@ export const upgradeCommand = buildCommand({
494494 flags,
495495 } ) ;
496496 if ( resolved . kind === "done" ) {
497- yield new CommandOutput ( resolved . result ) ;
498- return ;
497+ return yield new CommandOutput ( resolved . result ) ;
499498 }
500499
501500 const { target } = resolved ;
Original file line number Diff line number Diff line change @@ -225,8 +225,7 @@ export const planCommand = buildCommand({
225225 if ( ! flags . force ) {
226226 const existingSolution = extractSolution ( state ) ;
227227 if ( existingSolution ) {
228- yield new CommandOutput ( buildPlanData ( state ) ) ;
229- return ;
228+ return yield new CommandOutput ( buildPlanData ( state ) ) ;
230229 }
231230 }
232231
@@ -261,8 +260,7 @@ export const planCommand = buildCommand({
261260 throw new Error ( "Plan creation was cancelled." ) ;
262261 }
263262
264- yield new CommandOutput ( buildPlanData ( finalState ) ) ;
265- return ;
263+ return yield new CommandOutput ( buildPlanData ( finalState ) ) ;
266264 } catch ( error ) {
267265 // Handle API errors with friendly messages
268266 if ( error instanceof ApiError ) {
Original file line number Diff line number Diff line change @@ -405,8 +405,7 @@ export const createCommand = buildCommand({
405405 expectedSlug,
406406 dryRun : true ,
407407 } ;
408- yield new CommandOutput ( result ) ;
409- return ;
408+ return yield new CommandOutput ( result ) ;
410409 }
411410
412411 // Create the project
@@ -433,7 +432,6 @@ export const createCommand = buildCommand({
433432 expectedSlug,
434433 } ;
435434
436- yield new CommandOutput ( result ) ;
437- return ;
435+ return yield new CommandOutput ( result ) ;
438436 } ,
439437} ) ;
Original file line number Diff line number Diff line change @@ -307,13 +307,9 @@ export function buildCommand<
307307
308308 const mergedParams = { ...existingParams , flags : mergedFlags } ;
309309
310- function isCommandOutput ( v : unknown ) : v is CommandOutput < unknown > {
311- return v instanceof CommandOutput ;
312- }
313-
314310 /**
315- * If the yielded value is a branded {@link CommandOutput}, render it via
316- * the output config. Void/undefined/Error/non-branded values are ignored.
311+ * If the yielded value is a {@link CommandOutput}, render it via
312+ * the output config. Void/undefined/Error/other values are ignored.
317313 */
318314 function handleYieldedValue (
319315 stdout : Writer ,
@@ -322,13 +318,7 @@ export function buildCommand<
322318 // biome-ignore lint/suspicious/noExplicitAny: Renderer type mirrors erased OutputConfig<T>
323319 renderer ?: HumanRenderer < any >
324320 ) : void {
325- if (
326- ! ( outputConfig && renderer ) ||
327- value === null ||
328- value === undefined ||
329- value instanceof Error ||
330- ! isCommandOutput ( value )
331- ) {
321+ if ( ! ( outputConfig && renderer && value instanceof CommandOutput ) ) {
332322 return ;
333323 }
334324
You can’t perform that action at this time.
0 commit comments