Skip to content

Commit 0a5e7ff

Browse files
NorthernMan54cpenderykkocdkodeepak1556dependabot[bot]
authored
NodeJS 24 Support (#59)
* upgrade conpty from 1.20 to 1.22 (#56) Signed-off-by: Chapman Pendery <[email protected]> * Update package.json * Node js 24 (#58) * Port to NAPI (microsoft#644) * Port to NAPI The "5th pty bug" in microsoft#432 fixed also. * Fix help message in pty.cc * Move NAPI deps to devDependencies in package.json * Apply most of deepak1556's suggestions * Fix winpty * Fix conpty missing CloseHandle * Use unique_ptr to avoid `goto`s * Why macos failed? * fix: ci and minor cleanups * fix build failed on windows --------- Co-authored-by: deepak1556 <[email protected]> * build(deps): bump ip from 2.0.0 to 2.0.1 Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1. - [Commits](indutny/node-ip@v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: ip dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * api scan * fix job name * chore: fix APIScan software name (microsoft#667) * fix: comment out invalid API call (microsoft#669) * fix: assertion on node environment shutdown (microsoft#672) * Upgrade node-gyp to fix microsoft#643 and microsoft#646 (microsoft#673) * chore: remove deprecated api `process.binding` (microsoft#653) * Remove deprecated API `process.binding` Originally designed to work with ancient node.js 0.12 and io.js * Fix node `net.Socket` limitations nodejs/node#37780 * chore: migrate pipeline to use 1ES template (microsoft#676) * build(deps): bump tar from 6.2.0 to 6.2.1 Bumps [tar](https://github.com/isaacs/node-tar) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v6.2.0...v6.2.1) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * docs: add a note on Spectre-mitigated libraries (microsoft#679) * build(deps): bump braces from 3.0.2 to 3.0.3 Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](micromatch/braces@3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> * Include termios.h on freebsd * Get conpty.dll conditionally loading * Add conpty dlls and node headers * Add useConptyDll option * Copy conpty.dll and openconsole.exe depending on arch in postinstall * Ship third_party folder with module This needs to be there to copy over the right binary on postinstall Part of microsoft/vscode#224488 * Don't run CI for node 16 * Disable APIScan task * Fix winpty resize and reduce test flakiness * Publish third_party folder * Improve can't find conpty.dll exception message Part of microsoft/vscode#224488 * Get path of conpty.node for conpty.dll Part of microsoft/vscode#224488 * Update to newer version of conpty * Fix correct method being loaded when not using conptydll Part of microsoft/vscode#224488 * Copy right dll/exe based on npm_config_arch Part of microsoft/vscode#224488 Part of microsoft/vscode#225355 * Bring back clear impl Fixes microsoft#711 * Close piClient.hThread handle Fixes microsoft#717 * Move buffer_ to heap Resolves warning: src\win\path_util.cc(54): warning C6262: Function uses '131804' bytes of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap. * Catch possible exceptions in ~Agent Fixes warning: deps\winpty\src\agent\Agent.cc(231): warning C4722: 'Agent::~Agent': destructor never returns, potential memory leak * yarn.lock -> package-lock.json Fixes microsoft#712 * Regenerate dependencies * Fix typo in trace log Follow up microsoft#720 * Move to compile commands on postinstall for fixing intellisense Fixes microsoft#707 * chore: use node 20 and fix build (microsoft#730) * chore: use node 20 and fix build * chore: bump macOS deployment target * spec: reduce flakyness * Revert "chore: bump macOS deployment target" This reverts commit d9d18b3. --------- Co-authored-by: deepak1556 <[email protected]> * chore: add new publish pipeline (microsoft#727) Also allows the CI pipeline to use the Unofficial template * fix: ensure proper cleanup of console process on shutdown * fix: publish pipeline broken APIScan task (microsoft#756) * chore: improve cleanup with useConptyDll mode * chore: update tests * chore: auto-publish beta versions (microsoft#757) * chore: work around blocked release integration (microsoft#758) * Update to conpty v1.22 (microsoft#759) * Update to conpty v1.22 Fixes microsoft#490 * Add logs to show the problem happening * spec: increase exit delay * refactor: input and output handling with conpty * Close the input read and output write handles after creating the client process * Call ReleasePseudoConsole after creating the client process which will cause the output read handle to close when there is no more data from the session * For manual termination via Kill, we close the input write handle and call into ClosePseudoConsole, we should then drain the output handle NB: ideally draining the output handle should have been enough to cause the client process to close but it doesn't work, we call TerminateProcess to fix this case. * chore: restore legacy conpty path --------- Co-authored-by: deepak1556 <[email protected]> * chore: remove old publishing stage (microsoft#761) * fix: restore conpty non-dll path (microsoft#766) * chore: add BinSkim flags to winpty (microsoft#767) * chore: add BinSkim flags to winpty * Apply PR feedback * [email protected] * Change buffer size to 128KiB Fixes microsoft#765 * chore: match trigger with perf-bot's (microsoft#773) * chore: match exclude with latest conpty (microsoft#774) * chore: use folder wildcard (microsoft#775) * Revert "[email protected]" This reverts commit 247ae7d. * fix: gate conpty-exclusive call behind conpty check (microsoft#778) * NodeJS-24 * Node 20 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: kkocdko <[email protected]> Co-authored-by: deepak1556 <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Imms <[email protected]> Co-authored-by: SteVen Batten <[email protected]> Co-authored-by: Raymond Zhao <[email protected]> Co-authored-by: jpcastberg <[email protected]> * Working * Update validate for NodeJS 24 * Should now be working * Update Stage 2 - Validate.yml * Update Prepare prebuild environment.yml * Update Dockerfile.debian * Fix ? * Add git * Fix ? * Fixed * Update package-lock.json * Fix * Try again * Again * Update Stage 2 - Validate.yml * Windows fix * fix * Update updateABIRegistry.js * Update engines to match prebuilds --------- Signed-off-by: Chapman Pendery <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Chapman Pendery <[email protected]> Co-authored-by: kkocdko <[email protected]> Co-authored-by: deepak1556 <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Imms <[email protected]> Co-authored-by: SteVen Batten <[email protected]> Co-authored-by: Raymond Zhao <[email protected]> Co-authored-by: jpcastberg <[email protected]>
1 parent 38d6f8d commit 0a5e7ff

33 files changed

+4760
-6669
lines changed

.github/workflows/Prepare prebuild environment.yml

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
# Order reversed so newer versions are built first - Add new versions to the front (fail fast)
1818
# electronBuildTargets version 28 has an issue
1919
oldNodeBuildTargets: -t 17.0.1
20-
currentNodeBuildTargets: -t 23.0.0 -t 22.0.0 -t 21.0.0 -t 20.0.0 -t 19.0.0 -t 18.0.0
20+
currentNodeBuildTargets: -t 24.0.0 -t 23.0.0 -t 22.0.0 -t 21.0.0 -t 20.0.0 -t 19.0.0 -t 18.0.0
2121
oldElectronBuildTargets: -t 19.0.0 -t 18.0.0 -t 17.0.0
2222
electronBuildTargets: -t 29.0.0 -t 27.0.0 -t 26.0.0 -t 25.0.0 -t 24.0.0 -t 23.0.0 -t 22.0.0 -t 21.0.0 -t 20.0.0
2323
winIA32nodeBuildTargets: -t 17.0.1
@@ -92,9 +92,7 @@ jobs:
9292
darwin-x64,
9393
darwin-arm64,
9494
linux-ia32,
95-
linux-ia32-older,
9695
linux-x64,
97-
linux-x64-older,
9896
linux-arm,
9997
linux-arm64,
10098
# linux-arm64-older,
@@ -174,24 +172,6 @@ jobs:
174172

175173
# Builds for NodeJS 18 or lower
176174

177-
- name: linux-x64-older # Ok
178-
os: ubuntu-latest
179-
BASE_IMAGE: library/debian:9.6-slim
180-
DOCKERFILE: Dockerfile.oldDebian
181-
QEMU_ARCH: x86_64
182-
CMD: BuildOldCMD
183-
COUNT: 7
184-
NPMCOUNT: 3
185-
186-
- name: linux-ia32-older # Ok
187-
os: ubuntu-latest
188-
BASE_IMAGE: i386/debian:9.6-slim
189-
DOCKERFILE: Dockerfile.oldDebian
190-
QEMU_ARCH: i386
191-
CMD: BuildOldCMD
192-
COUNT: 7
193-
NPMCOUNT: 3
194-
195175
# - name: linux-arm64-older # Ok
196176
# os: ubuntu-latest
197177
# BASE_IMAGE: arm64v8/debian:9.6-slim
@@ -302,45 +282,35 @@ jobs:
302282

303283
# Windows
304284

305-
- name: Windows ia32 - Prebuild Binaries
306-
if: ${{ (runner.os == 'Windows') && (matrix.arch == 'ia32') }}
285+
- name: Windows ia32 - Update ABI Registry
286+
if: ${{ (runner.os == 'Windows') }}
307287
shell: bash
308288
run: |
309289
npm ci --ignore-scripts
290+
node .prebuild/updateAbiRegistry.js
291+
292+
- name: Windows ia32 - Prebuild Binaries
293+
if: ${{ (runner.os == 'Windows') && (matrix.arch == 'ia32') }}
294+
shell: bash
295+
run: |
310296
env JOBS=max node_modules/.bin/prebuild ${winIA32nodeBuildTargets} --include-regex "\.(node|exe|dll|pdb)" --arch ${{ matrix.arch }}
311297
env JOBS=max node_modules/.bin/prebuild ${winIA32electronBuildTargets} ${oldElectronBuildTargets} --include-regex "\.(node|exe|dll|pdb)" -r electron -a ${{ matrix.arch }}
312298
313299
- name: Windows x64 - Prebuild Binaries
314300
if: ${{ (runner.os == 'Windows') && (matrix.arch == 'x64') }}
315301
shell: bash
316302
run: |
317-
npm ci --ignore-scripts
318303
env JOBS=max node_modules/.bin/prebuild ${currentNodeBuildTargets} ${oldNodeBuildTargets} --include-regex "\.(node|exe|dll|pdb)" --arch ${{ matrix.arch }}
319304
env JOBS=max node_modules/.bin/prebuild ${electronBuildTargets} ${oldElectronBuildTargets} --include-regex "\.(node|exe|dll|pdb)" -r electron --arch ${{ matrix.arch }}
320305
321306
# Start of Checks
322307

323-
- name: Check Release prebuilds exist
324-
shell: bash
325-
run: |
326-
fileCount=$(ls prebuilds/*/node-pty*tar.gz | wc -l)
327-
echo "Release Prebuild count ${fileCount}"
328-
if [ "$fileCount" -ne ${{ matrix.COUNT }} ]; then echo "::warning::Release Prebuild count ${fileCount}, expected ${{ matrix.COUNT }}"; else echo "::notice::Release Prebuild count ${fileCount}, expected ${{ matrix.COUNT }}"; fi
329-
330308
- name: "Check file existence"
331309
id: check_files
332310
uses: andstor/file-existence-action@v3
333311
with:
334312
files: "prebuilds/*/node*node"
335313

336-
- name: Check NPM prebuilds exist
337-
if: steps.check_files.outputs.files_exists == 'true'
338-
shell: bash
339-
run: |
340-
fileCount=$(ls prebuilds/*/node*node | wc -l)
341-
echo "NPM Prebuild count ${fileCount}"
342-
if [ "$fileCount" -ne ${{ matrix.NPMCOUNT }} ]; then echo "::warning::Release NPM Prebuild count ${fileCount}, expected ${{ matrix.NPMCOUNT }}"; else echo "::notice::Release NPM Prebuild count ${fileCount}, expected ${{ matrix.NPMCOUNT }}"; fi
343-
344314
- name: What files were created unix
345315
if: ${{ (runner.os == 'macOS') || (runner.os == 'Linux') }}
346316
run: ls -R prebuilds
@@ -362,10 +332,6 @@ jobs:
362332
if-no-files-found: warn
363333
path: |
364334
archive.${{ matrix.name }}.tar.gz
365-
- name: "Output Results"
366-
run: |
367-
echo "::notice:: GitHub run_id: ${{ github.run_id }}"
368-
369335
370336
publish:
371337
name: Publish GitHub and NPM Release

.github/workflows/Stage 2 - Validate.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ name: Stage 2 - Validate NPM Package contents
22
run-name: Stage 2 - Validate against ${{ github.ref_name }}
33

44
on:
5-
push:
6-
branches: [latest, beta-*.*.*, beta, alpha-*.*.*, alpha]
75
pull_request:
86
branches: [latest, beta-*.*.*, beta]
97
types: [review_requested, ready_for_review]
108
workflow_dispatch:
9+
workflow_run:
10+
workflows: ["Stage 1 - Run prebuild's and Create GitHub and NPM release"]
11+
types:
12+
- completed
13+
branches: [latest, beta-*.*.*, beta, alpha-*.*.*, alpha]
1114

1215
jobs:
1316
# Validate that node-pty can be installed and ran across all platforms
1417
determine_tag:
1518
name: Determine Tag
1619
runs-on: ubuntu-latest
20+
# Only run if the Stage 1 workflow succeeded (for workflow_run) or always for other triggers
21+
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
1722
outputs:
1823
tag: ${{ steps.tag.outputs.tag }}
1924
steps:
@@ -35,7 +40,7 @@ jobs:
3540
strategy:
3641
fail-fast: false
3742
matrix:
38-
node-version: [18.x, 20.x, 22.x, 23.x]
43+
node-version: [18.x, 20.x, 22.x, 23.x, 24.x]
3944
os: [ubuntu-latest, ubuntu-24.04, ubuntu-22.04, macos-latest, macos-15, macos-14, macos-13, windows-latest, windows-2025, windows-2022, windows-2019]
4045

4146
runs-on: ${{ matrix.os }}
@@ -67,5 +72,4 @@ jobs:
6772
npm run postinstall
6873
6974
- run: |
70-
echo "::notice::Successfully tested ${{ github.ref_name }} on ${{ matrix.os }} with Node.js ${{ matrix.node-version }}"
71-
75+
echo "::notice::Successfully tested ${{ github.ref_name }} on ${{ matrix.os }} with Node.js ${{ matrix.node-version }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ fixtures/space folder/
1414
prebuilds
1515
.vscode/ipch/
1616
.idea
17+
yarn.lock

.prebuild/Dockerfile.debian

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ RUN [ "$(uname -m)" = "x86_64" ] && apt-get install -y g++-multilib gcc-multilib
1212

1313
## Linux 32 bit support was dropped with NodeJS 18.4.0
1414

15-
ENV NODE_VERSION 18.18.2
15+
ENV NODE_VERSION=18.18.2
1616

1717
RUN case "${QEMU_ARCH}" in \
18-
x86_64) NODE_ARCH='x64';; \
19-
arm) NODE_ARCH='armv7l';; \
20-
aarch64) NODE_ARCH='arm64';; \
21-
i386) NODE_ARCH='x86'; NODE_VERSION='18.4.0';; \
22-
*) echo "unsupported architecture"; exit 1 ;; \
18+
x86_64) NODE_ARCH='x64';; \
19+
arm) NODE_ARCH='armv7l';; \
20+
aarch64) NODE_ARCH='arm64';; \
21+
i386) NODE_ARCH='x86'; NODE_VERSION='18.4.0';; \
22+
*) echo "unsupported architecture"; exit 1 ;; \
2323
esac \
2424
&& set -x \
2525
&& [ "$NODE_ARCH" = "armv6l" -o "$NODE_ARCH" = "x86" ] && curl -k -SLO "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" || curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
2626
&& echo "Installing NodeJS node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
2727
&& tar -xzf "node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" -C /usr/local --strip-components=1 --no-same-owner \
2828
&& rm "node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
2929
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs
30-
30+
3131
RUN npm set prefix /usr/local
3232

3333
RUN mkdir /node-pty

.prebuild/Dockerfile.oldDebian

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ RUN [ "$(uname -m)" = "x86_64" ] && apt-get install -y g++-multilib gcc-multilib
1818
## Linux 32 bit support was dropped with NodeJS 18.4.0
1919

2020
RUN wget -q https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz && tar xf Python-3.6.15.tgz \
21-
&& cd Python-3.6.15 && ./configure --prefix=/usr --enable-optimizations --enable-shared && make -j8 build_all \
22-
&& make -j8 altinstall && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 50
21+
&& cd Python-3.6.15 && ./configure --prefix=/usr --enable-optimizations --enable-shared && make -j8 build_all \
22+
&& make -j8 altinstall && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 50
2323

24-
ENV NODE_VERSION 16.20.2
24+
ENV NODE_VERSION=16.20.2
2525

2626
RUN case "${QEMU_ARCH}" in \
27-
x86_64) NODE_ARCH='x64';; \
28-
arm) NODE_ARCH='armv6l';; \
29-
aarch64) NODE_ARCH='arm64';; \
30-
i386) NODE_ARCH='x86'; NODE_VERSION='18.4.0';; \
31-
*) echo "unsupported architecture"; exit 1 ;; \
27+
x86_64) NODE_ARCH='x64';; \
28+
arm) NODE_ARCH='armv6l';; \
29+
aarch64) NODE_ARCH='arm64';; \
30+
i386) NODE_ARCH='x86'; NODE_VERSION='18.4.0';; \
31+
*) echo "unsupported architecture"; exit 1 ;; \
3232
esac \
3333
&& set -x \
3434
&& [ "$NODE_ARCH" = "armv6l" -o "$NODE_ARCH" = "x86" ] && curl -SLO "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" || curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$NODE_ARCH.tar.gz" \
@@ -38,8 +38,6 @@ RUN case "${QEMU_ARCH}" in \
3838
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
3939
&& npm set prefix /usr/local
4040

41-
42-
4341
RUN mkdir /node-pty
4442
WORKDIR /node-pty
4543

.prebuild/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
set -e
4+
35
. /etc/os-release
46

57
cd /node-pty
@@ -31,6 +33,7 @@ echo
3133
#node .prebuild/build.js
3234
env JOBS=max node $*
3335
echo
36+
3437
#env JOBS=max node .prebuild/prebuild.js -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0
3538
#env JOBS=max node .prebuild/prebuildify.js -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0
3639

.prebuild/electron.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
1-
const fs = require('fs');
21
const os = require('os');
32
const path = require('path');
43
const child_process = require('child_process');
4+
const updateAbiRegistry = require('./updateABIRegistry');
55

6-
// node-abi is still shipping the wrong data
7-
// correct this issue manually for now
86
const prebuildPkgPath = path.dirname(require.resolve('prebuild'));
9-
const nodeAbiPkgPath = path.dirname(require.resolve('node-abi'));
107
const prebuildPath = path.resolve(prebuildPkgPath, 'bin.js');
11-
// const abiRegistryJsonPath = path.resolve(nodeAbiPkgPath, 'abi_registry.json');
12-
// fs.copyFileSync(path.resolve(__dirname, 'abi_registry.json'), abiRegistryJsonPath);
8+
9+
console.log('Prebuild Path:', prebuildPath);
10+
11+
// Update ABI registry before building
12+
updateAbiRegistry();
1313

1414
if (os.platform() === 'win32') {
1515
process.exit(0);
1616
}
1717

1818
const cwd = path.resolve(__dirname, '../');
1919

20-
21-
/**
20+
/**
2221
* --------------- Electron Build ---------------
2322
*/
2423

24+
const electronBuildTargets = [...process.argv];
2525

26-
var electronBuildTargets = [...process.argv];
27-
28-
electronBuildTargets.shift();
29-
electronBuildTargets.shift();
26+
electronBuildTargets.shift();
27+
electronBuildTargets.shift();
3028

3129
const electronBuildCmd = [
3230
prebuildPath,
3331
'-r',
3432
'electron',
3533
...electronBuildTargets,
36-
]
34+
];
3735

3836
console.log('Building for Electron:');
3937
console.log(electronBuildCmd.join(' '));
4038

4139
try {
42-
var result = child_process.spawnSync(process.execPath, electronBuildCmd, {
40+
const result = child_process.spawnSync(process.execPath, electronBuildCmd, {
4341
cwd: cwd,
4442
stdio: ['inherit', 'inherit', 'inherit']
4543
});
4644
console.log('electronBuild Result ', result.status, result.signal, result.error);
47-
if (result.status != 0) {
45+
if (result.status !== 0) {
4846
process.exit(1);
4947
}
5048
} catch (e) {

.prebuild/prebuild.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const fs = require('fs');
21
const os = require('os');
32
const path = require('path');
43
const child_process = require('child_process');
4+
const updateAbiRegistry = require('./updateABIRegistry');
55

6-
// node-abi is still shipping the wrong data
7-
// correct this issue manually for now
86
const prebuildPkgPath = path.dirname(require.resolve('prebuild'));
9-
const nodeAbiPkgPath = path.dirname(require.resolve('node-abi'));
107
const prebuildPath = path.resolve(prebuildPkgPath, 'bin.js');
11-
// const abiRegistryJsonPath = path.resolve(nodeAbiPkgPath, 'abi_registry.json');
12-
// fs.copyFileSync(path.resolve(__dirname, 'abi_registry.json'), abiRegistryJsonPath);
8+
9+
console.log('Prebuild Path:', prebuildPath);
10+
11+
// Update ABI registry before building
12+
updateAbiRegistry();
1313

1414
if (os.platform() === 'win32') {
1515
process.exit(0);
@@ -21,26 +21,26 @@ const cwd = path.resolve(__dirname, '../');
2121
* --------------- Node.js Build ---------------
2222
*/
2323

24-
var nodeBuildTargets = [...process.argv];
24+
const nodeBuildTargets = [...process.argv];
2525

26-
nodeBuildTargets.shift();
27-
nodeBuildTargets.shift();
26+
nodeBuildTargets.shift();
27+
nodeBuildTargets.shift();
2828

2929
const nodeBuildCmd = [
3030
prebuildPath,
3131
...nodeBuildTargets,
32-
]
32+
];
3333

3434
console.log('Prebuild for Node.js:');
3535
console.log(nodeBuildCmd.join(' '));
3636

3737
try {
38-
var result = child_process.spawnSync(process.execPath, nodeBuildCmd, {
38+
const result = child_process.spawnSync(process.execPath, nodeBuildCmd, {
3939
cwd: cwd,
4040
stdio: ['inherit', 'inherit', 'inherit']
4141
});
4242
console.log('Prebuild Result ', result.status, result.signal, result.error);
43-
if (result.status != 0) {
43+
if (result.status !== 0) {
4444
process.exit(1);
4545
}
4646
} catch (e) {

0 commit comments

Comments
 (0)