Skip to content

Commit af9993f

Browse files
committed
revert modified comments in codebase
1 parent c594afa commit af9993f

7 files changed

Lines changed: 118 additions & 40 deletions

File tree

src/command.ts

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,59 @@ import { ChildProcess as BaseChildProcess, SpawnOptions } from 'child_process';
22
import * as Rx from 'rxjs';
33
import { EventEmitter, Writable } from 'stream';
44

5-
/** Identifier for a command; if string, it's the command's name, if number, it's the index.*/
5+
/**
6+
* Identifier for a command; if string, it's the command's name, if number, it's the index.
7+
*/
68
export type CommandIdentifier = string | number;
79

810
export interface CommandInfo {
9-
/** Command's name. */
11+
/**
12+
* Command's name.
13+
*/
1014
name: string;
1115

12-
/** Which command line the command has. */
16+
/**
17+
* Which command line the command has.
18+
*/
1319
command: string;
1420

15-
/** Which environment variables should the spawned process have.*/
21+
/**
22+
* Which environment variables should the spawned process have.
23+
*/
1624
env?: Record<string, unknown>;
1725

18-
/** The current working directory of the process when spawned.*/
26+
/**
27+
* The current working directory of the process when spawned.
28+
*/
1929
cwd?: string;
2030

21-
/** Color to use on prefix of the command.*/
31+
/**
32+
* Color to use on prefix of the command.
33+
*/
2234
prefixColor?: string;
2335

24-
/** Output command in raw format.*/
36+
/**
37+
* Output command in raw format.
38+
*/
2539
raw?: boolean;
2640
}
2741

2842
export interface CloseEvent {
2943
command: CommandInfo;
3044

31-
/** The command's index among all commands ran.*/
45+
/**
46+
* The command's index among all commands ran.
47+
*/
3248
index: number;
3349

34-
/** Whether the command exited because it was killed.*/
50+
/**
51+
* Whether the command exited because it was killed.
52+
*/
3553
killed: boolean;
3654

37-
/** The exit code or signal for the command.*/
55+
/**
56+
* The exit code or signal for the command.
57+
*/
3858
exitCode: string | number;
3959
timings: {
4060
startDate: Date;
@@ -48,14 +68,20 @@ export interface TimerEvent {
4868
endDate?: Date;
4969
}
5070

51-
/** Subtype of NodeJS's child_process including only what's actually needed for a command to work. */
71+
/**
72+
* Subtype of NodeJS's child_process including only what's actually needed for a command to work.
73+
*/
5274
export type ChildProcess = EventEmitter &
5375
Pick<BaseChildProcess, 'pid' | 'stdin' | 'stdout' | 'stderr'>;
5476

55-
/** Interface for a function that must kill the process with `pid`, optionally sending `signal` to it. */
77+
/**
78+
* Interface for a function that must kill the process with `pid`, optionally sending `signal` to it.
79+
*/
5680
export type KillProcess = (pid: number, signal?: string) => void;
5781

58-
/** Interface for a function that spawns a command and returns its child process instance. */
82+
/**
83+
* Interface for a function that spawns a command and returns its child process instance.
84+
*/
5985
export type SpawnCommand = (command: string, options: SpawnOptions) => ChildProcess;
6086

6187
export class Command implements CommandInfo {
@@ -113,7 +139,9 @@ export class Command implements CommandInfo {
113139
this.spawnOpts = spawnOpts;
114140
}
115141

116-
/** Starts this command, piping output, error and close events onto the corresponding observables. */
142+
/**
143+
* Starts this command, piping output, error and close events onto the corresponding observables.
144+
*/
117145
start() {
118146
const child = this.spawn(this.command, this.spawnOpts);
119147
this.process = child;
@@ -162,7 +190,9 @@ export class Command implements CommandInfo {
162190
this.stdin = child.stdin || undefined;
163191
}
164192

165-
/** Kills this command, optionally specifying a signal to send to it. */
193+
/**
194+
* Kills this command, optionally specifying a signal to send to it.
195+
*/
166196
kill(code?: string) {
167197
if (Command.canKill(this)) {
168198
this.killed = true;
@@ -180,7 +210,9 @@ export class Command implements CommandInfo {
180210
}
181211
}
182212

183-
/** Pipes all events emitted by `stream` into `subject`.s */
213+
/**
214+
* Pipes all events emitted by `stream` into `subject`.
215+
*/
184216
function pipeTo<T>(stream: Rx.Observable<T>, subject: Rx.Subject<T>) {
185217
stream.subscribe((event) => subject.next(event));
186218
}

src/completion-listener.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export type SuccessCondition =
1919
| `command-${string | number}`
2020
| `!command-${string | number}`;
2121

22-
/** Provides logic to determine whether lists of commands ran successfully. */
22+
/**
23+
* Provides logic to determine whether lists of commands ran successfully.
24+
*/
2325
export class CompletionListener {
2426
private readonly successCondition: SuccessCondition;
2527
private readonly scheduler?: Rx.SchedulerLike;
@@ -36,7 +38,9 @@ export class CompletionListener {
3638
*/
3739
successCondition?: SuccessCondition;
3840

39-
/** For testing only.*/
41+
/**
42+
* For testing only.
43+
*/
4044
scheduler?: Rx.SchedulerLike;
4145
}) {
4246
this.successCondition = successCondition;

src/concurrently.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const defaults: ConcurrentlyOptions = {
3434
export type ConcurrentlyCommandInput = string | ({ command: string } & Partial<CommandInfo>);
3535

3636
export type ConcurrentlyResult = {
37-
/** All commands created and ran by concurrently.*/
37+
/**
38+
* All commands created and ran by concurrently.
39+
*/
3840
commands: Command[];
3941

4042
/**
@@ -49,10 +51,14 @@ export type ConcurrentlyResult = {
4951
export type ConcurrentlyOptions = {
5052
logger?: Logger;
5153

52-
/** Which stream should the commands output be written to. */
54+
/**
55+
* Which stream should the commands output be written to.
56+
*/
5357
outputStream?: Writable;
5458

55-
/** Whether the output should be ordered as if the commands were run sequentially.*/
59+
/**
60+
* Whether the output should be ordered as if the commands were run sequentially.
61+
*/
5662
group?: boolean;
5763

5864
/**

src/defaults.ts

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,29 @@ import { SuccessCondition } from './completion-listener';
66

77
export const defaultInputTarget = 0;
88

9-
/** Whether process.stdin should be forwarded to child processes. */
9+
/**
10+
* Whether process.stdin should be forwarded to child processes.
11+
*/
1012
export const handleInput = false;
1113

12-
/** How many processes to run at once. */
14+
/**
15+
* How many processes to run at once.
16+
*/
1317
export const maxProcesses = 0;
1418

15-
/** Indices and names of commands whose output are not to be logged. */
19+
/**
20+
* Indices and names of commands whose output are not to be logged.
21+
*/
1622
export const hide = '';
1723

18-
/** The character to split <names> on.*/
24+
/**
25+
* The character to split <names> on.
26+
*/
1927
export const nameSeparator = ',';
2028

21-
/** Which prefix style to use when logging processes output.*/
29+
/**
30+
* Which prefix style to use when logging processes output.
31+
*/
2232
export const prefix = '';
2333

2434
/**
@@ -27,18 +37,26 @@ export const prefix = '';
2737
*/
2838
export const prefixColors = 'reset';
2939

30-
/** How many bytes we'll show on the command prefix.*/
40+
/**
41+
* How many bytes we'll show on the command prefix.
42+
*/
3143
export const prefixLength = 10;
3244

3345
export const raw = false;
3446

35-
/** Number of attempts of restarting a process, if it exits with non-0 code. */
47+
/**
48+
* Number of attempts of restarting a process, if it exits with non-0 code.
49+
*/
3650
export const restartTries = 0;
3751

38-
/** How many milliseconds concurrently should wait before restarting a process. */
52+
/**
53+
* How many milliseconds concurrently should wait before restarting a process.
54+
*/
3955
export const restartDelay = 0;
4056

41-
/** Condition of success for concurrently itself. */
57+
/**
58+
* Condition of success for concurrently itself.
59+
*/
4260
export const success = 'all' as SuccessCondition;
4361

4462
/**
@@ -53,10 +71,14 @@ export const timestampFormat = 'yyyy-MM-dd HH:mm:ss.SSS';
5371
*/
5472
export const cwd: string | undefined = undefined;
5573

56-
/** Whether to show timing information for processes in console output. */
74+
/**
75+
* Whether to show timing information for processes in console output.
76+
*/
5777
export const timings = false;
5878

59-
/** Passthrough additional arguments to commands (accessible via placeholders) instead of treating them as commands. */
79+
/**
80+
* Passthrough additional arguments to commands (accessible via placeholders) instead of treating them as commands.
81+
*/
6082
export const passthroughArguments = false;
6183

6284
/**

src/get-spawn-opts.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export const getSpawnOpts = ({
1616
*/
1717
colorSupport?: Pick<supportsColor.supportsColor.Level, 'level'> | false;
1818

19-
/** The NodeJS process. */
19+
/**
20+
* The NodeJS process.
21+
*/
2022
process?: Pick<NodeJS.Process, 'cwd' | 'platform' | 'env'>;
2123

2224
/**
@@ -31,7 +33,9 @@ export const getSpawnOpts = ({
3133
*/
3234
raw?: boolean;
3335

34-
/** Map of custom environment variables to include in the spawn options. */
36+
/**
37+
* Map of custom environment variables to include in the spawn options.
38+
*/
3539
env?: Record<string, unknown>;
3640
}): SpawnOptions => ({
3741
cwd: cwd || process.cwd(),

src/index.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ import { LogTimings } from './flow-control/log-timings';
1818
import { RestartProcess } from './flow-control/restart-process';
1919
import { Logger } from './logger';
2020

21-
/** Logger options */
2221
export type ConcurrentlyOptions = BaseConcurrentlyOptions & {
23-
/** Which command(s) should have their output hidden. */
22+
// Logger options
23+
/**
24+
* Which command(s) should have their output hidden.
25+
*/
2426
hide?: CommandIdentifier | CommandIdentifier[];
2527

2628
/**
@@ -29,10 +31,14 @@ export type ConcurrentlyOptions = BaseConcurrentlyOptions & {
2931
*/
3032
prefix?: string;
3133

32-
/** How many characters should a prefix have at most, used when the prefix format is `command`. */
34+
/**
35+
* How many characters should a prefix have at most, used when the prefix format is `command`.
36+
*/
3337
prefixLength?: number;
3438

35-
/** Whether output should be formatted to include prefixes and whether "event" logs will be logged. */
39+
/**
40+
* Whether output should be formatted to include prefixes and whether "event" logs will be logged.
41+
*/
3642
raw?: boolean;
3743

3844
/**

src/logger.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ export class Logger {
3232
raw = false,
3333
timestampFormat,
3434
}: {
35-
/** Which command(s) should have their output hidden. */
35+
/**
36+
* Which command(s) should have their output hidden.
37+
*/
3638
hide?: CommandIdentifier | CommandIdentifier[];
3739

3840
/**
@@ -47,7 +49,9 @@ export class Logger {
4749
*/
4850
prefixFormat?: string;
4951

50-
/** How many characters should a prefix have at most, used when the prefix format is `command`. */
52+
/**
53+
* How many characters should a prefix have at most, used when the prefix format is `command`.
54+
*/
5155
prefixLength?: number;
5256

5357
/**

0 commit comments

Comments
 (0)