forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Pull Request resolved: facebook#44716 Move to listr2 which handle non-TTY environment, outputting to CircleCI logs in a useful way. This gives our CI users more useful debugging information, but limits the output when running locally. If you want more explicit output locally, do something like: ``` yarn run build | cat ``` Changelog: [Internal] Reviewed By: cortinico Differential Revision: D57915369 fbshipit-source-id: ae9f87b0b9608f16ee035b791c5f7b81544c498c
- Loading branch information
1 parent
c67dfbb
commit 32b5c96
Showing
5 changed files
with
215 additions
and
212 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,61 @@ | ||
/** | ||
* (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. | ||
* | ||
* @flow | ||
* @format | ||
*/ | ||
|
||
declare module 'listr2' { | ||
declare export type TaskResult< | ||
ContextT = {__proto__: null}, | ||
ReturnT = mixed, | ||
> = | ||
| ReturnT | ||
| Promise<ReturnT> | ||
| rxjs$Observable<ReturnT> | ||
| stream$Readable | ||
| Listr<ContextT>; | ||
|
||
declare type TaskFn<ContextT, ReturnT> = ( | ||
ctx: ContextT, | ||
task: TaskInstance, | ||
) => TaskResult<ContextT, ReturnT>; | ||
|
||
declare type SkipResultSync = boolean | string; | ||
declare type SkipResult = SkipResultSync | Promise<SkipResultSync>; | ||
declare type SkipFn<ContextT> = (ctx: ContextT) => SkipResult; | ||
|
||
declare type CustomRenderer = {...}; // TODO | ||
|
||
declare interface TaskInstance { | ||
title: string; | ||
output: string; | ||
skip(reason?: string): void; | ||
} | ||
|
||
declare export type TaskSpec< | ||
ContextT = {__proto__: null}, | ||
ReturnT = mixed, | ||
> = { | ||
title: string, | ||
task: TaskFn<ContextT, ReturnT>, | ||
skip?: SkipFn<ContextT>, | ||
}; | ||
|
||
declare export type Options = { | ||
concurrent?: boolean | number, | ||
exitOnError?: boolean, | ||
renderer?: 'default' | 'verbose' | 'silent' | CustomRenderer, | ||
nonTTYRenderer?: 'default' | 'verbose' | 'silent' | CustomRenderer, | ||
}; | ||
|
||
declare export class Listr<ContextT> { | ||
constructor<ReturnT>( | ||
tasks: Array<TaskSpec<ContextT, ReturnT>>, | ||
options?: Options, | ||
): void; | ||
add<ReturnT>(task: TaskSpec<ContextT, ReturnT>): this; | ||
add<ReturnT>(tasks: $ReadOnlyArray<TaskSpec<ContextT, ReturnT>>): this; | ||
run(ctx?: ContextT): Promise<ContextT>; | ||
} | ||
} |
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
Oops, something went wrong.