@rushstack/stream-collator 4.1.11 → 4.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -23
- package/README.md +57 -57
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/CollatedTerminal.js.map +1 -1
- package/lib/CollatedWriter.js.map +1 -1
- package/lib/StreamCollator.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
@rushstack/stream-collator
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
|
|
5
|
-
MIT License
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
-
a copy of this software and associated documentation files (the
|
|
9
|
-
"Software"), to deal in the Software without restriction, including
|
|
10
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
-
the following conditions:
|
|
14
|
-
|
|
15
|
-
The above copyright notice and this permission notice shall be
|
|
16
|
-
included in all copies or substantial portions of the Software.
|
|
17
|
-
|
|
18
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
19
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
20
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
21
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
22
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
23
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
1
|
+
@rushstack/stream-collator
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
|
|
5
|
+
MIT License
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
+
a copy of this software and associated documentation files (the
|
|
9
|
+
"Software"), to deal in the Software without restriction, including
|
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
+
the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be
|
|
16
|
+
included in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
21
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
22
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
23
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
24
24
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
## @rushstack/stream-collator
|
|
2
|
-
|
|
3
|
-
This library enables a tool to display live console output from multiple concurrent processes,
|
|
4
|
-
while ensuring that their output does not get jumbled together.
|
|
5
|
-
|
|
6
|
-
## How does it work?
|
|
7
|
-
|
|
8
|
-
The **stream-collator** manages the output of these streams, ensuring that no two streams are writing to the console
|
|
9
|
-
at the same time. At any given time, one stream registered with the collator is the **active stream**, which means
|
|
10
|
-
that particular stream will be live streaming, while the others will wait for that stream to finish before their
|
|
11
|
-
output is displayed.
|
|
12
|
-
|
|
13
|
-
For example, if you have 3 streams (e.g. from using `child_process.spawn()`).
|
|
14
|
-
|
|
15
|
-
Stream A will write: `AAAAA`
|
|
16
|
-
|
|
17
|
-
Stream B will write: `BBBBBBBBBBBBBBBBBBBB`
|
|
18
|
-
|
|
19
|
-
Stream C will write: `CCCCCCCCCC`
|
|
20
|
-
|
|
21
|
-
If these streams are all being piped directly to stdout (without `@rushstack/stream-collator`), you could end up
|
|
22
|
-
with jumbled output:
|
|
23
|
-
|
|
24
|
-
`ABACCCBCCCCBBABBCBBABBBBBBCCAB`
|
|
25
|
-
|
|
26
|
-
Something like the following would be much more useful to users of your application:
|
|
27
|
-
|
|
28
|
-
`AAAAABBBBBBBBBBBBBBBCCCCCCCCCC`
|
|
29
|
-
|
|
30
|
-
This is where the `@rushstack/stream-collator` comes in!
|
|
31
|
-
|
|
32
|
-
## The active stream
|
|
33
|
-
|
|
34
|
-
At any given time, a single stream is designated as the **active stream**. The output of the active stream will always be
|
|
35
|
-
live-streamed. This is particularly useful for long-running streams. When the active stream finishes, a new stream
|
|
36
|
-
is selected as the active stream and all of its contents up to that point will be emitted. Whenever an active stream finishes,
|
|
37
|
-
all background streams which have been completed will be emitted.
|
|
38
|
-
|
|
39
|
-
## Usage
|
|
40
|
-
|
|
41
|
-
> 🚨 _This is an early preview release. Please report issues!_ 🚨
|
|
42
|
-
>
|
|
43
|
-
> WITH VERSION 4.X, THIS PACKAGE HAS BEEN REDESIGNED TO USE THE NEW
|
|
44
|
-
> [@rushstack/terminal](https://www.npmjs.com/package/@rushstack/terminal) SYSTEM.
|
|
45
|
-
> IN THE NEXT RELEASE, THE `CollatedTerminal` API WILL BE REPLACED WITH
|
|
46
|
-
> THE `Terminal` API.
|
|
47
|
-
>
|
|
48
|
-
> The usage instructions will be updated once that refactoring is complete.
|
|
49
|
-
|
|
50
|
-
## Links
|
|
51
|
-
|
|
52
|
-
- [CHANGELOG.md](
|
|
53
|
-
https://github.com/microsoft/rushstack/blob/main/libraries/stream-collator/CHANGELOG.md) - Find
|
|
54
|
-
out what's new in the latest version
|
|
55
|
-
- [API Reference](https://rushstack.io/pages/api/stream-collator/)
|
|
56
|
-
|
|
57
|
-
`@rushstack/stream-collator` is part of the [Rush Stack](https://rushstack.io/) family of projects.
|
|
1
|
+
## @rushstack/stream-collator
|
|
2
|
+
|
|
3
|
+
This library enables a tool to display live console output from multiple concurrent processes,
|
|
4
|
+
while ensuring that their output does not get jumbled together.
|
|
5
|
+
|
|
6
|
+
## How does it work?
|
|
7
|
+
|
|
8
|
+
The **stream-collator** manages the output of these streams, ensuring that no two streams are writing to the console
|
|
9
|
+
at the same time. At any given time, one stream registered with the collator is the **active stream**, which means
|
|
10
|
+
that particular stream will be live streaming, while the others will wait for that stream to finish before their
|
|
11
|
+
output is displayed.
|
|
12
|
+
|
|
13
|
+
For example, if you have 3 streams (e.g. from using `child_process.spawn()`).
|
|
14
|
+
|
|
15
|
+
Stream A will write: `AAAAA`
|
|
16
|
+
|
|
17
|
+
Stream B will write: `BBBBBBBBBBBBBBBBBBBB`
|
|
18
|
+
|
|
19
|
+
Stream C will write: `CCCCCCCCCC`
|
|
20
|
+
|
|
21
|
+
If these streams are all being piped directly to stdout (without `@rushstack/stream-collator`), you could end up
|
|
22
|
+
with jumbled output:
|
|
23
|
+
|
|
24
|
+
`ABACCCBCCCCBBABBCBBABBBBBBCCAB`
|
|
25
|
+
|
|
26
|
+
Something like the following would be much more useful to users of your application:
|
|
27
|
+
|
|
28
|
+
`AAAAABBBBBBBBBBBBBBBCCCCCCCCCC`
|
|
29
|
+
|
|
30
|
+
This is where the `@rushstack/stream-collator` comes in!
|
|
31
|
+
|
|
32
|
+
## The active stream
|
|
33
|
+
|
|
34
|
+
At any given time, a single stream is designated as the **active stream**. The output of the active stream will always be
|
|
35
|
+
live-streamed. This is particularly useful for long-running streams. When the active stream finishes, a new stream
|
|
36
|
+
is selected as the active stream and all of its contents up to that point will be emitted. Whenever an active stream finishes,
|
|
37
|
+
all background streams which have been completed will be emitted.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
> 🚨 _This is an early preview release. Please report issues!_ 🚨
|
|
42
|
+
>
|
|
43
|
+
> WITH VERSION 4.X, THIS PACKAGE HAS BEEN REDESIGNED TO USE THE NEW
|
|
44
|
+
> [@rushstack/terminal](https://www.npmjs.com/package/@rushstack/terminal) SYSTEM.
|
|
45
|
+
> IN THE NEXT RELEASE, THE `CollatedTerminal` API WILL BE REPLACED WITH
|
|
46
|
+
> THE `Terminal` API.
|
|
47
|
+
>
|
|
48
|
+
> The usage instructions will be updated once that refactoring is complete.
|
|
49
|
+
|
|
50
|
+
## Links
|
|
51
|
+
|
|
52
|
+
- [CHANGELOG.md](
|
|
53
|
+
https://github.com/microsoft/rushstack/blob/main/libraries/stream-collator/CHANGELOG.md) - Find
|
|
54
|
+
out what's new in the latest version
|
|
55
|
+
- [API Reference](https://rushstack.io/pages/api/stream-collator/)
|
|
56
|
+
|
|
57
|
+
`@rushstack/stream-collator` is part of the [Rush Stack](https://rushstack.io/) family of projects.
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollatedTerminal.js","sourceRoot":"","sources":["../src/CollatedTerminal.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D;;;;GAIG;AACH,MAAa,gBAAgB;IAG3B,YAAmB,WAA6B;QAC9C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAEM,UAAU,CAAC,KAAqB;QACrC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAEM,eAAe,CAAC,OAAe;QACpC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,oCAA0B,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,eAAe,CAAC,OAAe;QACpC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,oCAA0B,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AAlBD,4CAkBC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\
|
|
1
|
+
{"version":3,"file":"CollatedTerminal.js","sourceRoot":"","sources":["../src/CollatedTerminal.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAI3D;;;;GAIG;AACH,MAAa,gBAAgB;IAG3B,YAAmB,WAA6B;QAC9C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAEM,UAAU,CAAC,KAAqB;QACrC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAEM,eAAe,CAAC,OAAe;QACpC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,oCAA0B,EAAE,CAAC,CAAC;IACzF,CAAC;IAEM,eAAe,CAAC,OAAe;QACpC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,IAAI,oCAA0B,EAAE,CAAC,CAAC;IACzF,CAAC;CACF;AAlBD,4CAkBC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type ITerminalChunk, TerminalChunkKind, type TerminalWritable } from '@rushstack/terminal';\n\n/**\n * This API was introduced as a temporary measure.\n * @deprecated Very soon we plan to replace this with the `Terminal` API from `@rushstack/node-core-library`.\n * @beta\n */\nexport class CollatedTerminal {\n private readonly _destination: TerminalWritable;\n\n public constructor(destination: TerminalWritable) {\n this._destination = destination;\n }\n\n public writeChunk(chunk: ITerminalChunk): void {\n this._destination.writeChunk(chunk);\n }\n\n public writeStdoutLine(message: string): void {\n this._destination.writeChunk({ text: message + '\\n', kind: TerminalChunkKind.Stdout });\n }\n\n public writeStderrLine(message: string): void {\n this._destination.writeChunk({ text: message + '\\n', kind: TerminalChunkKind.Stderr });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollatedWriter.js","sourceRoot":"","sources":["../src/CollatedWriter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kDAA4E;AAG5E,yDAAsD;AAEtD;;;;GAIG;AACH,MAAa,cAAe,SAAQ,2BAAgB;IAOlD,YAAmB,QAAgB,EAAE,QAAwB;QAC3D,KAAK,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,KAAK,IAAI,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,sEAAsE;IAC/D,YAAY,CAAC,KAAqB;QACvC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAED,iEAAiE;IAC1D,OAAO;QACZ,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC;IAED,gBAAgB;IACT,oBAAoB;QACzB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,eAAe,EAAE;YACxC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SAC9C;QACD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,CAAC;CACF;AAlDD,wCAkDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\
|
|
1
|
+
{"version":3,"file":"CollatedWriter.js","sourceRoot":"","sources":["../src/CollatedWriter.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kDAA4E;AAG5E,yDAAsD;AAEtD;;;;GAIG;AACH,MAAa,cAAe,SAAQ,2BAAgB;IAOlD,YAAmB,QAAgB,EAAE,QAAwB;QAC3D,KAAK,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;QAElC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,mCAAgB,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,KAAK,IAAI,CAAC;IAC9C,CAAC;IAED;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,sEAAsE;IAC/D,YAAY,CAAC,KAAqB;QACvC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAED,iEAAiE;IAC1D,OAAO;QACZ,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAC1D,CAAC;IAED,gBAAgB;IACT,oBAAoB;QACzB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,eAAe,EAAE;YACxC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SAC9C;QACD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,CAAC;CACF;AAlDD,wCAkDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { type ITerminalChunk, TerminalWritable } from '@rushstack/terminal';\n\nimport type { StreamCollator } from './StreamCollator';\nimport { CollatedTerminal } from './CollatedTerminal';\n\n/**\n * An writable interface for managing output of simultaneous processes.\n *\n * @beta\n */\nexport class CollatedWriter extends TerminalWritable {\n private readonly _collator: StreamCollator;\n private readonly _bufferedChunks: ITerminalChunk[];\n\n public readonly taskName: string;\n public readonly terminal: CollatedTerminal;\n\n public constructor(taskName: string, collator: StreamCollator) {\n super({ preventAutoclose: true });\n\n this.taskName = taskName;\n this.terminal = new CollatedTerminal(this);\n\n this._collator = collator;\n\n this._bufferedChunks = [];\n }\n\n /**\n * Returns true if this is the active writer for its associated {@link StreamCollator}.\n */\n public get isActive(): boolean {\n return this._collator.activeWriter === this;\n }\n\n /**\n * For diagnostic purposes, if the writer is buffering chunks because it has\n * not become active yet, they can be inspected via this property.\n */\n public get bufferedChunks(): ReadonlyArray<ITerminalChunk> {\n return this._bufferedChunks;\n }\n\n /** {@inheritDoc @rushstack/terminal#TerminalWritable.onWriteChunk} */\n public onWriteChunk(chunk: ITerminalChunk): void {\n this._collator._writerWriteChunk(this, chunk, this._bufferedChunks);\n }\n\n /** {@inheritDoc @rushstack/terminal#TerminalWritable.onClose} */\n public onClose(): void {\n this._collator._writerClose(this, this._bufferedChunks);\n }\n\n /** @internal */\n public _flushBufferedChunks(): void {\n for (const chunk of this._bufferedChunks) {\n this._collator.destination.writeChunk(chunk);\n }\n this._bufferedChunks.length = 0;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1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7D;IACH,CAAC;CACF;AAtKD,wCAsKC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\r\n// See LICENSE in the project root for license information.\r\n\r\nimport { InternalError } from '@rushstack/node-core-library';\r\nimport type { TerminalWritable, ITerminalChunk } from '@rushstack/terminal';\r\n\r\nimport { CollatedWriter } from './CollatedWriter';\r\nimport { CollatedTerminal } from './CollatedTerminal';\r\n\r\n/**\r\n * Constructor options for {@link StreamCollator}.\r\n *\r\n * @beta\r\n */\r\nexport interface IStreamCollatorOptions {\r\n /**\r\n * The target {@link @rushstack/terminal#TerminalWritable} object that the\r\n * {@link StreamCollator} will write its output to.\r\n */\r\n destination: TerminalWritable;\r\n\r\n /**\r\n * An event handler that is called when a {@link CollatedWriter} becomes output,\r\n * before any of its chunks have been written to the destination.\r\n *\r\n * @remarks\r\n *\r\n * Each `CollatedWriter` object will become active exactly once\r\n * before the `StreamCollator` completes.\r\n */\r\n onWriterActive?: (writer: CollatedWriter) => void;\r\n}\r\n\r\n/**\r\n * A static class which manages the output of multiple threads.\r\n *\r\n * @beta\r\n */\r\nexport class StreamCollator {\r\n private _taskNames: Set<string> = new Set();\r\n private _writers: Set<CollatedWriter> = new Set();\r\n\r\n // The writer whose output is being shown in realtime, or undefined if none\r\n private _activeWriter: CollatedWriter | undefined = undefined;\r\n\r\n // Writers that are not closed yet, and have never been active\r\n private _openInactiveWriters: Set<CollatedWriter> = new Set();\r\n\r\n // Writers that are now closed, but have accumulated buffered chunks, and have never been active\r\n private _closedInactiveWriters: Set<CollatedWriter> = new Set();\r\n\r\n private _onWriterActive: ((writer: CollatedWriter) => void) | undefined;\r\n\r\n private _preventReentrantCall: boolean = false;\r\n\r\n public readonly destination: TerminalWritable;\r\n public readonly terminal: CollatedTerminal;\r\n\r\n public constructor(options: IStreamCollatorOptions) {\r\n this.destination = options.destination;\r\n this.terminal = new CollatedTerminal(this.destination);\r\n this._onWriterActive = options.onWriterActive;\r\n }\r\n\r\n /**\r\n * Returns the currently active `CollatedWriter`, or `undefined` if no writer\r\n * is active yet.\r\n */\r\n public get activeWriter(): CollatedWriter | undefined {\r\n return this._activeWriter;\r\n }\r\n\r\n /**\r\n * For diagnostic purposes, returns the {@link CollatedWriter.taskName} for the\r\n * currently active writer, or an empty string if no writer is active.\r\n */\r\n public get activeTaskName(): string {\r\n if (this._activeWriter) {\r\n return this._activeWriter.taskName;\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * The list of writers that have been registered by calling {@link StreamCollator.registerTask},\r\n * in the order that they were registered.\r\n */\r\n public get writers(): ReadonlySet<CollatedWriter> {\r\n return this._writers;\r\n }\r\n\r\n /**\r\n * Registers a new task to be collated, and constructs a {@link CollatedWriter} object\r\n * to receive its input.\r\n */\r\n public registerTask(taskName: string): CollatedWriter {\r\n if (this._taskNames.has(taskName)) {\r\n throw new Error('A task with that name has already been registered');\r\n }\r\n\r\n const writer: CollatedWriter = new CollatedWriter(taskName, this);\r\n\r\n this._writers.add(writer);\r\n this._taskNames.add(writer.taskName);\r\n\r\n // When a task is initially registered, it is open and has not accumulated any buffered chunks\r\n this._openInactiveWriters.add(writer);\r\n\r\n if (this._activeWriter === undefined) {\r\n // If there is no active writer, then the first one to be registered becomes active.\r\n this._assignActiveWriter(writer);\r\n }\r\n\r\n return writer;\r\n }\r\n\r\n /** @internal */\r\n public _writerWriteChunk(\r\n writer: CollatedWriter,\r\n chunk: ITerminalChunk,\r\n bufferedChunks: ITerminalChunk[]\r\n ): void {\r\n this._checkForReentrantCall();\r\n\r\n if (this._activeWriter === undefined) {\r\n // If no writer is currently active, then the first one to write something becomes active\r\n this._assignActiveWriter(writer);\r\n }\r\n\r\n if (writer.isActive) {\r\n this.destination.writeChunk(chunk);\r\n } else {\r\n bufferedChunks.push(chunk);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _writerClose(writer: CollatedWriter, bufferedChunks: ITerminalChunk[]): void {\r\n this._checkForReentrantCall();\r\n\r\n if (writer.isActive) {\r\n writer._flushBufferedChunks();\r\n\r\n this._activeWriter = undefined;\r\n\r\n // If any buffered writers are already closed, activate them each immediately\r\n // We copy the set, since _assignActiveWriter() will be deleting from it.\r\n for (const closedInactiveWriter of [...this._closedInactiveWriters]) {\r\n try {\r\n this._assignActiveWriter(closedInactiveWriter);\r\n } finally {\r\n this._activeWriter = undefined;\r\n }\r\n }\r\n\r\n let writerToActivate: CollatedWriter | undefined = undefined;\r\n\r\n // Try to activate a writer that already accumulated some data\r\n for (const openInactiveWriter of this._openInactiveWriters) {\r\n if (openInactiveWriter.bufferedChunks.length > 0) {\r\n writerToActivate = openInactiveWriter;\r\n break;\r\n }\r\n }\r\n if (!writerToActivate) {\r\n // Otherwise just take the first one\r\n for (const openInactiveWriter of this._openInactiveWriters) {\r\n writerToActivate = openInactiveWriter;\r\n break;\r\n }\r\n }\r\n\r\n if (writerToActivate) {\r\n this._assignActiveWriter(writerToActivate);\r\n }\r\n } else {\r\n this._openInactiveWriters.delete(writer);\r\n this._closedInactiveWriters.add(writer);\r\n }\r\n }\r\n\r\n private _assignActiveWriter(writer: CollatedWriter): void {\r\n this._activeWriter = writer;\r\n\r\n this._closedInactiveWriters.delete(writer);\r\n this._openInactiveWriters.delete(writer);\r\n\r\n if (this._onWriterActive) {\r\n this._preventReentrantCall = true;\r\n try {\r\n this._onWriterActive(writer);\r\n } finally {\r\n this._preventReentrantCall = false;\r\n }\r\n }\r\n\r\n writer._flushBufferedChunks();\r\n }\r\n\r\n private _checkForReentrantCall(): void {\r\n if (this._preventReentrantCall) {\r\n throw new InternalError('Reentrant call to StreamCollator');\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"StreamCollator.js","sourceRoot":"","sources":["../src/StreamCollator.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,oEAA6D;AAG7D,qDAAkD;AAClD,yDAAsD;AA0BtD;;;;GAIG;AACH,MAAa,cAAc;IAoBzB,YAAmB,OAA+B;QAnB1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,kBAAkB,CAAC;oBACtC,MAAM;iBACP;aACF;YACD,IAAI,CAAC,gBAAgB,EAAE;gBACrB,oCAAoC;gBACpC,KAAK,MAAM,kBAAkB,IAAI,IAAI,CAAC,oBAAoB,EAAE;oBAC1D,gBAAgB,GAAG,kBAAkB,CAAC;oBACtC,MAAM;iBACP;aACF;YAED,IAAI,gBAAgB,EAAE;gBACpB,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;aAC5C;SACF;aAAM;YACL,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACzC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;SACzC;IACH,CAAC;IAEO,mBAAmB,CAAC,MAAsB;QAChD,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAE5B,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAEzC,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;YAClC,IAAI;gBACF,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;aAC9B;oBAAS;gBACR,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;aACpC;SACF;QAED,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEO,sBAAsB;QAC5B,IAAI,IAAI,CAAC,qBAAqB,EAAE;YAC9B,MAAM,IAAI,iCAAa,CAAC,kCAAkC,CAAC,CAAC;SAC7D;IACH,CAAC;CACF;AAtKD,wCAsKC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { InternalError } from '@rushstack/node-core-library';\nimport type { TerminalWritable, ITerminalChunk } from '@rushstack/terminal';\n\nimport { CollatedWriter } from './CollatedWriter';\nimport { CollatedTerminal } from './CollatedTerminal';\n\n/**\n * Constructor options for {@link StreamCollator}.\n *\n * @beta\n */\nexport interface IStreamCollatorOptions {\n /**\n * The target {@link @rushstack/terminal#TerminalWritable} object that the\n * {@link StreamCollator} will write its output to.\n */\n destination: TerminalWritable;\n\n /**\n * An event handler that is called when a {@link CollatedWriter} becomes output,\n * before any of its chunks have been written to the destination.\n *\n * @remarks\n *\n * Each `CollatedWriter` object will become active exactly once\n * before the `StreamCollator` completes.\n */\n onWriterActive?: (writer: CollatedWriter) => void;\n}\n\n/**\n * A static class which manages the output of multiple threads.\n *\n * @beta\n */\nexport class StreamCollator {\n private _taskNames: Set<string> = new Set();\n private _writers: Set<CollatedWriter> = new Set();\n\n // The writer whose output is being shown in realtime, or undefined if none\n private _activeWriter: CollatedWriter | undefined = undefined;\n\n // Writers that are not closed yet, and have never been active\n private _openInactiveWriters: Set<CollatedWriter> = new Set();\n\n // Writers that are now closed, but have accumulated buffered chunks, and have never been active\n private _closedInactiveWriters: Set<CollatedWriter> = new Set();\n\n private _onWriterActive: ((writer: CollatedWriter) => void) | undefined;\n\n private _preventReentrantCall: boolean = false;\n\n public readonly destination: TerminalWritable;\n public readonly terminal: CollatedTerminal;\n\n public constructor(options: IStreamCollatorOptions) {\n this.destination = options.destination;\n this.terminal = new CollatedTerminal(this.destination);\n this._onWriterActive = options.onWriterActive;\n }\n\n /**\n * Returns the currently active `CollatedWriter`, or `undefined` if no writer\n * is active yet.\n */\n public get activeWriter(): CollatedWriter | undefined {\n return this._activeWriter;\n }\n\n /**\n * For diagnostic purposes, returns the {@link CollatedWriter.taskName} for the\n * currently active writer, or an empty string if no writer is active.\n */\n public get activeTaskName(): string {\n if (this._activeWriter) {\n return this._activeWriter.taskName;\n }\n return '';\n }\n\n /**\n * The list of writers that have been registered by calling {@link StreamCollator.registerTask},\n * in the order that they were registered.\n */\n public get writers(): ReadonlySet<CollatedWriter> {\n return this._writers;\n }\n\n /**\n * Registers a new task to be collated, and constructs a {@link CollatedWriter} object\n * to receive its input.\n */\n public registerTask(taskName: string): CollatedWriter {\n if (this._taskNames.has(taskName)) {\n throw new Error('A task with that name has already been registered');\n }\n\n const writer: CollatedWriter = new CollatedWriter(taskName, this);\n\n this._writers.add(writer);\n this._taskNames.add(writer.taskName);\n\n // When a task is initially registered, it is open and has not accumulated any buffered chunks\n this._openInactiveWriters.add(writer);\n\n if (this._activeWriter === undefined) {\n // If there is no active writer, then the first one to be registered becomes active.\n this._assignActiveWriter(writer);\n }\n\n return writer;\n }\n\n /** @internal */\n public _writerWriteChunk(\n writer: CollatedWriter,\n chunk: ITerminalChunk,\n bufferedChunks: ITerminalChunk[]\n ): void {\n this._checkForReentrantCall();\n\n if (this._activeWriter === undefined) {\n // If no writer is currently active, then the first one to write something becomes active\n this._assignActiveWriter(writer);\n }\n\n if (writer.isActive) {\n this.destination.writeChunk(chunk);\n } else {\n bufferedChunks.push(chunk);\n }\n }\n\n /** @internal */\n public _writerClose(writer: CollatedWriter, bufferedChunks: ITerminalChunk[]): void {\n this._checkForReentrantCall();\n\n if (writer.isActive) {\n writer._flushBufferedChunks();\n\n this._activeWriter = undefined;\n\n // If any buffered writers are already closed, activate them each immediately\n // We copy the set, since _assignActiveWriter() will be deleting from it.\n for (const closedInactiveWriter of [...this._closedInactiveWriters]) {\n try {\n this._assignActiveWriter(closedInactiveWriter);\n } finally {\n this._activeWriter = undefined;\n }\n }\n\n let writerToActivate: CollatedWriter | undefined = undefined;\n\n // Try to activate a writer that already accumulated some data\n for (const openInactiveWriter of this._openInactiveWriters) {\n if (openInactiveWriter.bufferedChunks.length > 0) {\n writerToActivate = openInactiveWriter;\n break;\n }\n }\n if (!writerToActivate) {\n // Otherwise just take the first one\n for (const openInactiveWriter of this._openInactiveWriters) {\n writerToActivate = openInactiveWriter;\n break;\n }\n }\n\n if (writerToActivate) {\n this._assignActiveWriter(writerToActivate);\n }\n } else {\n this._openInactiveWriters.delete(writer);\n this._closedInactiveWriters.add(writer);\n }\n }\n\n private _assignActiveWriter(writer: CollatedWriter): void {\n this._activeWriter = writer;\n\n this._closedInactiveWriters.delete(writer);\n this._openInactiveWriters.delete(writer);\n\n if (this._onWriterActive) {\n this._preventReentrantCall = true;\n try {\n this._onWriterActive(writer);\n } finally {\n this._preventReentrantCall = false;\n }\n }\n\n writer._flushBufferedChunks();\n }\n\n private _checkForReentrantCall(): void {\n if (this._preventReentrantCall) {\n throw new InternalError('Reentrant call to StreamCollator');\n }\n }\n}\n"]}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;AAE3D;;;;;;;;;;GAUG;AAEH,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;AAE3D;;;;;;;;;;GAUG;AAEH,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * This library enables a tool to display live console output from multiple concurrent processes,\n * while ensuring that their output does not get jumbled together.\n *\n * @remarks\n *\n * For more info, please see the package {@link https://www.npmjs.com/package/@rushstack/stream-collator\n * | README}.\n *\n * @packageDocumentation\n */\n\nexport * from './CollatedTerminal';\nexport * from './CollatedWriter';\nexport * from './StreamCollator';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/stream-collator",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.12",
|
|
4
4
|
"description": "Display intelligible realtime output from concurrent processes",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@rushstack/node-core-library": "3.61.0",
|
|
15
|
-
"@rushstack/terminal": "0.7.
|
|
15
|
+
"@rushstack/terminal": "0.7.11"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@rushstack/heft": "0.63.
|
|
18
|
+
"@rushstack/heft": "0.63.1",
|
|
19
19
|
"local-node-rig": "1.0.0"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|