Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .configurations/configuration.vsBuildTools.dsc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
# Reference: https://github.com/nodejs/node/blob/main/BUILDING.md#windows
properties:
resources:
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: pythonPackage
directives:
description: Install Python 3.14
module: Microsoft.WinGet.DSC
allowPrerelease: true
settings:
id: Python.Python.3.14
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
directives:
description: Install Visual Studio 2022 Build Tools
allowPrerelease: true
settings:
id: Microsoft.VisualStudio.2022.BuildTools
source: winget
useLatest: true
- resource: Microsoft.VisualStudio.DSC/VSComponents
id: vsComponents
dependsOn:
- vsPackage
directives:
description: Install required VS workloads and components
allowPrerelease: true
settings:
productId: Microsoft.VisualStudio.Product.BuildTools
channelId: VisualStudio.17.Release
includeRecommended: true
components:
- Microsoft.VisualStudio.Workload.VCTools
- Microsoft.VisualStudio.Component.VC.Llvm.Clang
- Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: gitPackage
directives:
description: Install Git
allowPrerelease: true
settings:
id: Git.Git
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: nasmPackage
directives:
description: Install NetWide Assembler (NASM)
allowPrerelease: true
settings:
id: Nasm.Nasm
source: winget
configurationVersion: 0.1.1
22 changes: 18 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -780,23 +780,37 @@ first and then reinstalling them.

##### Option 2: Automated install with WinGet

[WinGet configuration files](https://github.com/nodejs/node/tree/main/.configurations)
[WinGet configuration files](./.configurations)
can be used to install all the required prerequisites for Node.js development
easily. These files will install the following
[WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) packages:

* Git for Windows with the `git` and Unix tools added to the `PATH`
* `Python 3.14`
* `Visual Studio 2022` (Community, Enterprise or Professional)
* `Visual Studio 2022 Build Tools` with Visual C++ workload, Clang and ClangToolset
* `Visual Studio 2022` (Build Tools, Community, Professional or Enterprise Edition) and
"Desktop development with C++" workload, Clang and ClangToolset optional components
* `NetWide Assembler`

To install Node.js prerequisites from PowerShell Terminal:
The following Desired State Configuration (DSC) files are available:

| Edition | DSC Configuration |
| ------------ | ------------------------------------------------------------------------------------------------ |
| Build Tools | [configuration.vsBuildTools.dsc.yaml](./.configurations/configuration.vsBuildTools.dsc.yaml) |
| Community | [configuration.dsc.yaml](./.configurations/configuration.dsc.yaml) |
| Professional | [configuration.vsProfessional.dsc.yaml](./.configurations/configuration.vsProfessional.dsc.yaml) |
| Enterprise | [configuration.vsEnterprise.dsc.yaml](./.configurations/configuration.vsEnterprise.dsc.yaml) |

Use one of the above DSC files with
[winget configure](https://learn.microsoft.com/en-us/windows/package-manager/winget/configure#configure-subcommands)
in a PowerShell Terminal to install Node.js prerequisites.
For example, using the DSC file for Visual Studio Community Edition, execute the following command line:

```powershell
winget configure .\.configurations\configuration.dsc.yaml
```

To add optional components for MSI or ARM64 builds, refer to [Option 1: Manual install](#option-1-manual-install).

##### Option 3: Automated install with Boxstarter

A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -889,11 +889,11 @@ releases on a rotation basis as outlined in the
* [bengl](https://github.com/bengl) -
**Bryan English** <<bryan@bryanenglish.com>> (he/him)
* [HeroDevs](https://www.herodevs.com/)
* [juanarbol](https://github.com/juanarbol) - OpenJSF handle: `juanarbol`
**Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
* [marco-ippolito](https://github.com/marco-ippolito) - OpenJSF handle: `Marco Ippolito`
**Marco Ippolito** <<marcoippolito54@gmail.com>> (he/him)
* [NodeSource](https://nodesource.com/)
* [juanarbol](https://github.com/juanarbol) -
**Juan José Arboleda** <<soyjuanarbol@gmail.com>> (he/him)
* [RafaelGSS](https://github.com/RafaelGSS) - OpenJSF handle: `RafaelGSS`
**Rafael Gonzaga** <<rafael.nunu@hotmail.com>> (he/him)
* [Platformatic](https://platformatic.dev/)
Expand Down
3 changes: 2 additions & 1 deletion lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ function on(emitter, event, options = kEmptyObject) {
const value = unconsumedEvents.shift();
size--;
if (paused && size < lowWatermark) {
emitter.resume();
emitter.resume(); // Can not be finished yet
paused = false;
}
return PromiseResolve(createIterResult(value, false));
Expand Down Expand Up @@ -1191,6 +1191,7 @@ function on(emitter, event, options = kEmptyObject) {
abortListenerDisposable?.[SymbolDispose]();
removeAll();
finished = true;
paused = false;
const doneResult = createIterResult(undefined, true);
while (!unconsumedPromises.isEmpty()) {
unconsumedPromises.shift().resolve(doneResult);
Expand Down
4 changes: 2 additions & 2 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,19 @@ ZlibBase.prototype.reset = function() {
};

/**
* @this {ZlibBase}
* This is the _flush function called by the transform class,
* internally, when the last chunk has been written.
* @returns {void}
* @this {ZlibBase}
*/
ZlibBase.prototype._flush = function(callback) {
this._transform(new FastBuffer(), '', callback);
};

/**
* @this {ZlibBase}
* Force Transform compat behavior.
* @returns {void}
* @this {ZlibBase}
*/
ZlibBase.prototype._final = function(callback) {
callback();
Expand Down
25 changes: 25 additions & 0 deletions test/parallel/test-readline-async-iterators.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const testContents = [
'line 1',
'line 1\nline 2 南越国是前203年至前111年存在于岭南地区的一个国家\nline 3\ntrailing',
'line 1\nline 2\nline 3 ends with newline\n',
Array(1e4).fill(0).map((_, i) => i).join('\n'), // More that 2 * highWaterMark
];

async function testSimple() {
Expand All @@ -43,6 +44,29 @@ async function testSimple() {
}
}

// Same as testSimple, but with Readable.from() instead of fs.createReadStream
async function testReadableFrom() {
for (const fileContent of testContents) {
const readable = Readable.from([fileContent]);
const rli = readline.createInterface({
input: readable,
crlfDelay: Infinity
});

const iteratedLines = [];
for await (const k of rli) {
iteratedLines.push(k);
}

const expectedLines = fileContent.split('\n');
if (expectedLines[expectedLines.length - 1] === '') {
expectedLines.pop();
}
assert.deepStrictEqual(iteratedLines, expectedLines);
assert.strictEqual(iteratedLines.join(''), fileContent.replace(/\n/g, ''));
}
}

async function testMutual() {
for (const fileContent of testContents) {
fs.writeFileSync(filename, fileContent);
Expand Down Expand Up @@ -115,6 +139,7 @@ async function testSlowStreamForLeaks() {
}

testSimple()
.then(testReadableFrom)
.then(testMutual)
.then(testSlowStreamForLeaks)
.then(common.mustCall());
6 changes: 3 additions & 3 deletions tools/doc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading