-
Notifications
You must be signed in to change notification settings - Fork 692
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(react-email): Improved error feedback on all CLI commands (#1784)
- Loading branch information
1 parent
7ae1acf
commit 6781316
Showing
9 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"react-email": patch | ||
--- | ||
|
||
Improve error messages for all CLI commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
packages/react-email/src/utils/register-spinner-autostopping.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import logSymbols from 'log-symbols'; | ||
import type { Ora } from 'ora'; | ||
|
||
const spinners = new Set<Ora>(); | ||
|
||
process.on('SIGINT', () => { | ||
spinners.forEach((spinner) => { | ||
if (spinner.isSpinning) { | ||
spinner.stop(); | ||
} | ||
}); | ||
}); | ||
|
||
process.on('exit', (code) => { | ||
if (code !== 0) { | ||
spinners.forEach((spinner) => { | ||
if (spinner.isSpinning) { | ||
spinner.stopAndPersist({ | ||
symbol: logSymbols.error, | ||
}); | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
export const registerSpinnerAutostopping = (spinner: Ora) => { | ||
spinners.add(spinner); | ||
}; |