-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into lemusthelroy/ct-1160-point-build-system-to-n…
…ew-endpoint
- Loading branch information
Showing
33 changed files
with
281 additions
and
72 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ type EventHandlers = { | |
| { | ||
handler: NetlifyPlugin[K] | ||
description: string | ||
quiet?: boolean | ||
} | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Transform } from 'stream' | ||
|
||
const flusherSymbol = Symbol.for('@netlify/output-gate') | ||
|
||
/** | ||
* Utility class for conditionally rendering certain output only if additional | ||
* data flows through. The constructor takes a "buffer" function that renders | ||
* the optional data. When flushed, that function is called. | ||
*/ | ||
export class OutputFlusher { | ||
private buffer: () => void | ||
|
||
flushed: boolean | ||
|
||
constructor(bufferFn: () => void) { | ||
this.flushed = false | ||
this.buffer = bufferFn | ||
} | ||
|
||
flush() { | ||
if (!this.flushed) { | ||
this.buffer() | ||
this.flushed = true | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* A `Transform` stream that takes an `OutputFlusher` instance and flushes it | ||
* whenever data flows through, before piping the data to its destination. | ||
*/ | ||
export class OutputFlusherTransform extends Transform { | ||
[flusherSymbol]: OutputFlusher | ||
|
||
constructor(flusher: OutputFlusher) { | ||
super() | ||
|
||
this[flusherSymbol] = flusher | ||
} | ||
|
||
_transform(chunk: any, _: string, callback: () => void) { | ||
this[flusherSymbol].flush() | ||
|
||
this.push(chunk) | ||
|
||
callback() | ||
} | ||
} |
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
Oops, something went wrong.