Skip to content

Commit

Permalink
rebase me
Browse files Browse the repository at this point in the history
  • Loading branch information
crherman7 committed May 13, 2024
1 parent 59e8319 commit cb3a54c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/cli/src/cmds/prebuild.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ program
*/
const { unmount } = render(<Actions />, { stdout: process.stderr });

// @ts-ignore
global.unmount = unmount;

/**
Expand Down
26 changes: 26 additions & 0 deletions packages/cli/src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Global variable to store the unmount function from react-ink.
*
* @global
* @type {string | undefined}
*/
declare global {
var unmount:
| ((error?: number | Error | null | undefined) => void)
| undefined;
}

/**
* Export an empty object to ensure proper module augmentation in TypeScript.
*
* @remarks
* This export statement is needed to allow merging declarations with the global scope.
* Without it, TypeScript will not recognize the global variable declarations.
*
* @example
* ```typescript
* // Use an empty export to allow merging with global declarations
* export {};
* ```
*/
export {};
3 changes: 1 addition & 2 deletions packages/cli/src/lib/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export function withAction<TResult, TArgs extends unknown[]>(

emitter.emit("action", { name: group, status: "fail" });

//@ts-ignore
// global.unmount();
global.unmount?.();
logger.resume();
logger.info(chalk.red`💥 Oops something went wrong! See errors below.
Expand Down

0 comments on commit cb3a54c

Please sign in to comment.